diff options
author | clang-format-7.0.1 <adam.martin@10gen.com> | 2019-07-26 18:20:35 -0400 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2019-07-27 11:02:23 -0400 |
commit | 134a4083953270e8a11430395357fb70a29047ad (patch) | |
tree | dd428e1230e31d92b20b393dfdc17ffe7fa79cb6 /src/mongo/db/query/collation/collator_factory_icu_test.cpp | |
parent | 1e46b5049003f427047e723ea5fab15b5a9253ca (diff) | |
download | mongo-134a4083953270e8a11430395357fb70a29047ad.tar.gz |
SERVER-41772 Apply clang-format 7.0.1 to the codebase
Diffstat (limited to 'src/mongo/db/query/collation/collator_factory_icu_test.cpp')
-rw-r--r-- | src/mongo/db/query/collation/collator_factory_icu_test.cpp | 176 |
1 files changed, 55 insertions, 121 deletions
diff --git a/src/mongo/db/query/collation/collator_factory_icu_test.cpp b/src/mongo/db/query/collation/collator_factory_icu_test.cpp index 7024303dffd..d7d0edce54b 100644 --- a/src/mongo/db/query/collation/collator_factory_icu_test.cpp +++ b/src/mongo/db/query/collation/collator_factory_icu_test.cpp @@ -61,8 +61,7 @@ TEST(CollatorFactoryICUTest, SimpleLocaleWithOtherFieldsFailsToParse) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "simple" - << "caseLevel" - << true)); + << "caseLevel" << true)); ASSERT_NOT_OK(collator.getStatus()); ASSERT_EQ(collator.getStatus(), ErrorCodes::FailedToParse); } @@ -444,8 +443,7 @@ TEST(CollatorFactoryICUTest, CaseLevelFalseParsesSuccessfully) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "caseLevel" - << false)); + << "caseLevel" << false)); ASSERT_OK(collator.getStatus()); ASSERT_FALSE(collator.getValue()->getSpec().caseLevel); } @@ -454,8 +452,7 @@ TEST(CollatorFactoryICUTest, CaseLevelTrueParsesSuccessfully) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "caseLevel" - << true)); + << "caseLevel" << true)); ASSERT_OK(collator.getStatus()); ASSERT_TRUE(collator.getValue()->getSpec().caseLevel); } @@ -497,8 +494,7 @@ TEST(CollatorFactoryICUTest, PrimaryStrengthParsesSuccessfully) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 1)); + << "strength" << 1)); ASSERT_OK(collator.getStatus()); ASSERT_EQ(static_cast<int>(CollationSpec::StrengthType::kPrimary), static_cast<int>(collator.getValue()->getSpec().strength)); @@ -508,8 +504,7 @@ TEST(CollatorFactoryICUTest, SecondaryStrengthParsesSuccessfully) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 2)); + << "strength" << 2)); ASSERT_OK(collator.getStatus()); ASSERT_EQ(static_cast<int>(CollationSpec::StrengthType::kSecondary), static_cast<int>(collator.getValue()->getSpec().strength)); @@ -519,8 +514,7 @@ TEST(CollatorFactoryICUTest, TertiaryStrengthParsesSuccessfully) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 3)); + << "strength" << 3)); ASSERT_OK(collator.getStatus()); ASSERT_EQ(static_cast<int>(CollationSpec::StrengthType::kTertiary), static_cast<int>(collator.getValue()->getSpec().strength)); @@ -530,8 +524,7 @@ TEST(CollatorFactoryICUTest, QuaternaryStrengthParsesSuccessfully) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 4)); + << "strength" << 4)); ASSERT_OK(collator.getStatus()); ASSERT_EQ(static_cast<int>(CollationSpec::StrengthType::kQuaternary), static_cast<int>(collator.getValue()->getSpec().strength)); @@ -541,8 +534,7 @@ TEST(CollatorFactoryICUTest, IdenticalStrengthParsesSuccessfully) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 5)); + << "strength" << 5)); ASSERT_OK(collator.getStatus()); ASSERT_EQ(static_cast<int>(CollationSpec::StrengthType::kIdentical), static_cast<int>(collator.getValue()->getSpec().strength)); @@ -552,8 +544,7 @@ TEST(CollatorFactoryICUTest, NumericOrderingFalseParsesSuccessfully) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "numericOrdering" - << false)); + << "numericOrdering" << false)); ASSERT_OK(collator.getStatus()); ASSERT_FALSE(collator.getValue()->getSpec().numericOrdering); } @@ -562,8 +553,7 @@ TEST(CollatorFactoryICUTest, NumericOrderingTrueParsesSuccessfully) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "numericOrdering" - << true)); + << "numericOrdering" << true)); ASSERT_OK(collator.getStatus()); ASSERT_TRUE(collator.getValue()->getSpec().numericOrdering); } @@ -616,8 +606,7 @@ TEST(CollatorFactoryICUTest, NormalizationFalseParsesSuccessfully) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "normalization" - << false)); + << "normalization" << false)); ASSERT_OK(collator.getStatus()); ASSERT_FALSE(collator.getValue()->getSpec().normalization); } @@ -626,8 +615,7 @@ TEST(CollatorFactoryICUTest, NormalizationTrueParsesSuccessfully) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "normalization" - << true)); + << "normalization" << true)); ASSERT_OK(collator.getStatus()); ASSERT_TRUE(collator.getValue()->getSpec().normalization); } @@ -636,8 +624,7 @@ TEST(CollatorFactoryICUTest, BackwardsFalseParsesSuccessfully) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "backwards" - << false)); + << "backwards" << false)); ASSERT_OK(collator.getStatus()); ASSERT_FALSE(collator.getValue()->getSpec().backwards); } @@ -646,8 +633,7 @@ TEST(CollatorFactoryICUTest, BackwardsTrueParsesSuccessfully) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "backwards" - << true)); + << "backwards" << true)); ASSERT_OK(collator.getStatus()); ASSERT_TRUE(collator.getValue()->getSpec().backwards); } @@ -656,8 +642,7 @@ TEST(CollatorFactoryICUTest, LongStrengthFieldParsesSuccessfully) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 1LL)); + << "strength" << 1LL)); ASSERT_OK(collator.getStatus()); ASSERT_EQ(static_cast<int>(CollationSpec::StrengthType::kPrimary), static_cast<int>(collator.getValue()->getSpec().strength)); @@ -667,8 +652,7 @@ TEST(CollatorFactoryICUTest, DoubleStrengthFieldParsesSuccessfully) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 1.0)); + << "strength" << 1.0)); ASSERT_OK(collator.getStatus()); ASSERT_EQ(static_cast<int>(CollationSpec::StrengthType::kPrimary), static_cast<int>(collator.getValue()->getSpec().strength)); @@ -688,8 +672,7 @@ TEST(CollatorFactoryICUTest, NonStringCaseFirstFieldFailsToParse) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "caseFirst" - << 1)); + << "caseFirst" << 1)); ASSERT_NOT_OK(collator.getStatus()); ASSERT_EQ(collator.getStatus(), ErrorCodes::TypeMismatch); } @@ -718,8 +701,7 @@ TEST(CollatorFactoryICUTest, TooLargeStrengthFieldFailsToParse) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 2147483648LL)); + << "strength" << 2147483648LL)); ASSERT_NOT_OK(collator.getStatus()); ASSERT_EQ(collator.getStatus(), ErrorCodes::FailedToParse); } @@ -728,8 +710,7 @@ TEST(CollatorFactoryICUTest, FractionalStrengthFieldFailsToParse) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 0.5)); + << "strength" << 0.5)); ASSERT_NOT_OK(collator.getStatus()); ASSERT_EQ(collator.getStatus(), ErrorCodes::BadValue); } @@ -738,8 +719,7 @@ TEST(CollatorFactoryICUTest, NegativeStrengthFieldFailsToParse) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << -1)); + << "strength" << -1)); ASSERT_NOT_OK(collator.getStatus()); ASSERT_EQ(collator.getStatus(), ErrorCodes::FailedToParse); } @@ -748,8 +728,7 @@ TEST(CollatorFactoryICUTest, InvalidIntegerStrengthFieldFailsToParse) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 6)); + << "strength" << 6)); ASSERT_NOT_OK(collator.getStatus()); ASSERT_EQ(collator.getStatus(), ErrorCodes::FailedToParse); } @@ -768,8 +747,7 @@ TEST(CollatorFactoryICUTest, NonStringAlternateFieldFailsToParse) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "alternate" - << 1)); + << "alternate" << 1)); ASSERT_NOT_OK(collator.getStatus()); ASSERT_EQ(collator.getStatus(), ErrorCodes::TypeMismatch); } @@ -788,8 +766,7 @@ TEST(CollatorFactoryICUTest, NonStringMaxVariableFieldFailsToParse) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "maxVariable" - << 1)); + << "maxVariable" << 1)); ASSERT_NOT_OK(collator.getStatus()); ASSERT_EQ(collator.getStatus(), ErrorCodes::TypeMismatch); } @@ -846,8 +823,7 @@ TEST(CollatorFactoryICUTest, NonStringVersionFieldFailsToParse) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "version" - << 3)); + << "version" << 3)); ASSERT_NOT_OK(collator.getStatus()); ASSERT_EQ(collator.getStatus(), ErrorCodes::TypeMismatch); } @@ -879,8 +855,7 @@ TEST(CollatorFactoryICUTest, PrimaryStrengthCollatorIgnoresCaseAndAccents) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 1)); + << "strength" << 1)); ASSERT_OK(collator.getStatus()); // u8"\u00E1" is latin small letter a with acute. @@ -892,8 +867,7 @@ TEST(CollatorFactoryICUTest, SecondaryStrengthCollatorsIgnoresCaseButNotAccents) CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 2)); + << "strength" << 2)); ASSERT_OK(collator.getStatus()); // u8"\u00E1" is latin small letter a with acute. @@ -905,8 +879,7 @@ TEST(CollatorFactoryICUTest, TertiaryStrengthCollatorConsidersCaseAndAccents) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 3)); + << "strength" << 3)); ASSERT_OK(collator.getStatus()); // u8"\u00E1" is latin small letter a with acute. @@ -918,10 +891,7 @@ TEST(CollatorFactoryICUTest, PrimaryStrengthCaseLevelTrue) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 1 - << "caseLevel" - << true)); + << "strength" << 1 << "caseLevel" << true)); ASSERT_OK(collator.getStatus()); // u8"\u00E1" is latin small letter a with acute. @@ -931,14 +901,11 @@ TEST(CollatorFactoryICUTest, PrimaryStrengthCaseLevelTrue) { TEST(CollatorFactoryICUTest, PrimaryStrengthCaseLevelTrueCaseFirstUpper) { CollatorFactoryICU factory; - auto collator = factory.makeFromBSON(BSON("locale" - << "en_US" - << "strength" - << 1 - << "caseLevel" - << true - << "caseFirst" - << "upper")); + auto collator = + factory.makeFromBSON(BSON("locale" + << "en_US" + << "strength" << 1 << "caseLevel" << true << "caseFirst" + << "upper")); ASSERT_OK(collator.getStatus()); // u8"\u00E1" is latin small letter a with acute. @@ -948,14 +915,11 @@ TEST(CollatorFactoryICUTest, PrimaryStrengthCaseLevelTrueCaseFirstUpper) { TEST(CollatorFactoryICUTest, TertiaryStrengthCaseLevelTrueCaseFirstUpper) { CollatorFactoryICU factory; - auto collator = factory.makeFromBSON(BSON("locale" - << "en_US" - << "strength" - << 3 - << "caseLevel" - << true - << "caseFirst" - << "upper")); + auto collator = + factory.makeFromBSON(BSON("locale" + << "en_US" + << "strength" << 3 << "caseLevel" << true << "caseFirst" + << "upper")); ASSERT_OK(collator.getStatus()); ASSERT_LT(collator.getValue()->compare("A", "a"), 0); } @@ -972,8 +936,7 @@ TEST(CollatorFactoryICUTest, NumericOrderingTrue) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "numericOrdering" - << true)); + << "numericOrdering" << true)); ASSERT_OK(collator.getStatus()); ASSERT_LT(collator.getValue()->compare("2", "10"), 0); } @@ -982,9 +945,7 @@ TEST(CollatorFactoryICUTest, PrimaryStrengthAlternateShifted) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 1 - << "alternate" + << "strength" << 1 << "alternate" << "shifted")); ASSERT_OK(collator.getStatus()); ASSERT_EQ(collator.getValue()->compare("a b", "ab"), 0); @@ -995,9 +956,7 @@ TEST(CollatorFactoryICUTest, QuaternaryStrengthAlternateShifted) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 4 - << "alternate" + << "strength" << 4 << "alternate" << "shifted")); ASSERT_OK(collator.getStatus()); ASSERT_LT(collator.getValue()->compare("a b", "ab"), 0); @@ -1008,9 +967,7 @@ TEST(CollatorFactoryICUTest, PrimaryStrengthAlternateShiftedMaxVariableSpace) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 1 - << "alternate" + << "strength" << 1 << "alternate" << "shifted" << "maxVariable" << "space")); @@ -1023,8 +980,7 @@ TEST(CollatorFactoryICUTest, SecondaryStrengthBackwardsFalse) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 2)); + << "strength" << 2)); ASSERT_OK(collator.getStatus()); // u8"\u00E1" is latin small letter a with acute. @@ -1035,10 +991,7 @@ TEST(CollatorFactoryICUTest, SecondaryStrengthBackwardsTrue) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "strength" - << 2 - << "backwards" - << true)); + << "strength" << 2 << "backwards" << true)); ASSERT_OK(collator.getStatus()); // u8"\u00E1" is latin small letter a with acute. @@ -1069,10 +1022,7 @@ TEST(CollatorFactoryICUTest, BackwardsTrueWithStrengthOneFails) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "backwards" - << true - << "strength" - << 1)); + << "backwards" << true << "strength" << 1)); ASSERT_NOT_OK(collator.getStatus()); } @@ -1080,10 +1030,7 @@ TEST(CollatorFactoryICUTest, BackwardsTrueWithStrengthTwoSucceeds) { CollatorFactoryICU factory; auto collator = factory.makeFromBSON(BSON("locale" << "en_US" - << "backwards" - << true - << "strength" - << 2)); + << "backwards" << true << "strength" << 2)); ASSERT_OK(collator.getStatus()); } @@ -1093,8 +1040,7 @@ TEST(CollatorFactoryICUTest, CaseFirstLowerWithStrengthThreeSucceeds) { << "en_US" << "caseFirst" << "lower" - << "strength" - << 3)); + << "strength" << 3)); ASSERT_OK(collator.getStatus()); } @@ -1104,8 +1050,7 @@ TEST(CollatorFactoryICUTest, CaseFirstUpperWithStrengthThreeSucceeds) { << "en_US" << "caseFirst" << "upper" - << "strength" - << 3)); + << "strength" << 3)); ASSERT_OK(collator.getStatus()); } @@ -1115,10 +1060,7 @@ TEST(CollatorFactoryICUTest, CaseFirstLowerWithCaseLevelSucceeds) { << "en_US" << "caseFirst" << "lower" - << "caseLevel" - << true - << "strength" - << 1)); + << "caseLevel" << true << "strength" << 1)); ASSERT_OK(collator.getStatus()); } @@ -1128,10 +1070,7 @@ TEST(CollatorFactoryICUTest, CaseFirstUpperWithCaseLevelSucceeds) { << "en_US" << "caseFirst" << "upper" - << "caseLevel" - << true - << "strength" - << 1)); + << "caseLevel" << true << "strength" << 1)); ASSERT_OK(collator.getStatus()); } @@ -1141,8 +1080,7 @@ TEST(CollatorFactoryICUTest, CaseFirstOffWithStrengthOneSucceeds) { << "en_US" << "caseFirst" << "off" - << "strength" - << 1)); + << "strength" << 1)); ASSERT_OK(collator.getStatus()); } @@ -1152,8 +1090,7 @@ TEST(CollatorFactoryICUTest, CaseFirstLowerWithStrengthOneFails) { << "en_US" << "caseFirst" << "lower" - << "strength" - << 1)); + << "strength" << 1)); ASSERT_NOT_OK(collator.getStatus()); } @@ -1163,8 +1100,7 @@ TEST(CollatorFactoryICUTest, CaseFirstLowerWithStrengthTwoFails) { << "en_US" << "caseFirst" << "lower" - << "strength" - << 2)); + << "strength" << 2)); ASSERT_NOT_OK(collator.getStatus()); } @@ -1174,8 +1110,7 @@ TEST(CollatorFactoryICUTest, CaseFirstUpperWithStrengthOneFails) { << "en_US" << "caseFirst" << "upper" - << "strength" - << 1)); + << "strength" << 1)); ASSERT_NOT_OK(collator.getStatus()); } @@ -1185,8 +1120,7 @@ TEST(CollatorFactoryICUTest, CaseFirstUpperWithStrengthTwoFails) { << "en_US" << "caseFirst" << "upper" - << "strength" - << 2)); + << "strength" << 2)); ASSERT_NOT_OK(collator.getStatus()); } |