Browse Source

CPP: libphonenumber 4.7.

This is mainly a metadata update.

Modified files:
cpp/src/phonenumbers/lite_metadata.cc
cpp/src/phonenumbers/metadata.cc
cpp/src/phonenumbers/phonenumberutil.cc
cpp/test/phonenumbers/phonenumbermatcher_test.cc

Review URL: https://codereview.appspot.com/6028044
pull/567/head
Philippe Liard 14 years ago
committed by Mihaela Rosca
parent
commit
ea615a7316
4 changed files with 19845 additions and 19773 deletions
  1. +9314
    -9285
      cpp/src/phonenumbers/lite_metadata.cc
  2. +10515
    -10482
      cpp/src/phonenumbers/metadata.cc
  3. +1
    -1
      cpp/src/phonenumbers/phonenumberutil.cc
  4. +15
    -5
      cpp/test/phonenumbers/phonenumbermatcher_test.cc

+ 9314
- 9285
cpp/src/phonenumbers/lite_metadata.cc
File diff suppressed because it is too large
View File


+ 10515
- 10482
cpp/src/phonenumbers/metadata.cc
File diff suppressed because it is too large
View File


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

@ -1286,7 +1286,7 @@ void PhoneNumberUtil::FormatOutOfCountryKeepingAlphaChars(
}
}
const PhoneMetadata* metadata = GetMetadataForRegion(calling_from);
if (number.country_code() == kNanpaCountryCode) {
if (country_code == kNanpaCountryCode) {
if (IsNANPACountry(calling_from)) {
StrAppend(formatted_number, country_code, " ", raw_input_copy);
return;


+ 15
- 5
cpp/test/phonenumbers/phonenumbermatcher_test.cc View File

@ -1010,7 +1010,17 @@ TEST_F(PhoneNumberMatcherTest, MaxMatchesMixed) {
EXPECT_EQ(expected, actual);
}
TEST_F(PhoneNumberMatcherTest, TestEmptyIteration) {
TEST_F(PhoneNumberMatcherTest, NonPlusPrefixedNumbersNotFoundForInvalidRegion) {
PhoneNumberMatch match;
scoped_ptr<PhoneNumberMatcher> matcher(
GetMatcherWithLeniency("1 456 764 156", RegionCode::GetUnknown(),
PhoneNumberMatcher::VALID));
EXPECT_FALSE(matcher->HasNext());
EXPECT_FALSE(matcher->Next(&match));
EXPECT_FALSE(matcher->HasNext());
}
TEST_F(PhoneNumberMatcherTest, EmptyIteration) {
PhoneNumberMatch match;
scoped_ptr<PhoneNumberMatcher> matcher(
GetMatcherWithLeniency("", RegionCode::GetUnknown(),
@ -1021,7 +1031,7 @@ TEST_F(PhoneNumberMatcherTest, TestEmptyIteration) {
EXPECT_FALSE(matcher->HasNext());
}
TEST_F(PhoneNumberMatcherTest, TestSingleIteration) {
TEST_F(PhoneNumberMatcherTest, SingleIteration) {
PhoneNumberMatch match;
scoped_ptr<PhoneNumberMatcher> matcher(
GetMatcherWithLeniency("+14156667777", RegionCode::GetUnknown(),
@ -1036,7 +1046,7 @@ TEST_F(PhoneNumberMatcherTest, TestSingleIteration) {
EXPECT_FALSE(matcher->Next(&match));
}
TEST_F(PhoneNumberMatcherTest, TestSingleIteration_WithNextOnly) {
TEST_F(PhoneNumberMatcherTest, SingleIteration_WithNextOnly) {
PhoneNumberMatch match;
scoped_ptr<PhoneNumberMatcher> matcher(
GetMatcherWithLeniency("+14156667777", RegionCode::GetUnknown(),
@ -1045,7 +1055,7 @@ TEST_F(PhoneNumberMatcherTest, TestSingleIteration_WithNextOnly) {
EXPECT_FALSE(matcher->Next(&match));
}
TEST_F(PhoneNumberMatcherTest, TestDoubleIteration) {
TEST_F(PhoneNumberMatcherTest, DoubleIteration) {
PhoneNumberMatch match;
scoped_ptr<PhoneNumberMatcher> matcher(
GetMatcherWithLeniency("+14156667777 foobar +14156667777 ",
@ -1065,7 +1075,7 @@ TEST_F(PhoneNumberMatcherTest, TestDoubleIteration) {
EXPECT_FALSE(matcher->HasNext());
}
TEST_F(PhoneNumberMatcherTest, TestDoubleIteration_WithNextOnly) {
TEST_F(PhoneNumberMatcherTest, DoubleIteration_WithNextOnly) {
PhoneNumberMatch match;
scoped_ptr<PhoneNumberMatcher> matcher(
GetMatcherWithLeniency("+14156667777 foobar +14156667777 ",


Loading…
Cancel
Save