Browse Source

CPP: Fix PhoneNumberMatcher build in Chrome.

Contributors:
  - leandrogracia@chromium.org
  - georgey@chromium.org

Review URL: https://codereview.appspot.com/5627046
pull/567/head
Philippe Liard 14 years ago
committed by Mihaela Rosca
parent
commit
f1cbc4af44
2 changed files with 5 additions and 4 deletions
  1. +1
    -1
      cpp/src/phonenumbers/phonenumbermatcher.cc
  2. +4
    -3
      cpp/test/phonenumbers/phonenumbermatcher_test.cc

+ 1
- 1
cpp/src/phonenumbers/phonenumbermatcher.cc View File

@ -207,7 +207,7 @@ class PhoneNumberMatcherRegExps : public Singleton<PhoneNumberMatcherRegExps> {
scoped_ptr<const RegExp> pattern_;
#ifdef USE_GOOGLE_BASE
PhoneNumberMatcherRegExps* PhoneNumberMatcherRegExps::GetInstance() {
static PhoneNumberMatcherRegExps* GetInstance() {
return Singleton<PhoneNumberMatcherRegExps>::get();
}
#endif // USE_GOOGLE_BASE


+ 4
- 3
cpp/test/phonenumbers/phonenumbermatcher_test.cc View File

@ -526,15 +526,16 @@ TEST_F(PhoneNumberMatcherTest, MatchWithSurroundingZipcodes) {
TEST_F(PhoneNumberMatcherTest, IsLatinLetter) {
EXPECT_TRUE(IsLatinLetter('c'));
EXPECT_TRUE(IsLatinLetter('C'));
EXPECT_TRUE(IsLatinLetter(UnicodeString("\xC3\x89" /* "É" */)[0]));
EXPECT_TRUE(IsLatinLetter(UnicodeString::fromUTF8("\xC3\x89" /* "É" */)[0]));
// Combining acute accent.
EXPECT_TRUE(IsLatinLetter(UnicodeString("\xCC\x81")[0]));
EXPECT_TRUE(IsLatinLetter(UnicodeString::fromUTF8("\xCC\x81")[0]));
EXPECT_FALSE(IsLatinLetter(':'));
EXPECT_FALSE(IsLatinLetter('5'));
EXPECT_FALSE(IsLatinLetter('-'));
EXPECT_FALSE(IsLatinLetter('.'));
EXPECT_FALSE(IsLatinLetter(' '));
EXPECT_FALSE(IsLatinLetter(UnicodeString("\xE6\x88\x91" /* "我" */)[0]));
EXPECT_FALSE(
IsLatinLetter(UnicodeString::fromUTF8("\xE6\x88\x91" /* "我" */)[0]));
}
TEST_F(PhoneNumberMatcherTest, MatchesWithSurroundingLatinChars) {


Loading…
Cancel
Save