From 8dd8d59f0cc9ee5e4c446031790973a6cb51970e Mon Sep 17 00:00:00 2001 From: tcsnfkx <72578982+tcsnfkx@users.noreply.github.com> Date: Wed, 19 Jan 2022 13:16:23 -0800 Subject: [PATCH] Minor fixes. (#29) * Check for Status explicitly when calling IsOk. * Remove unused "using" statement. * Fix tests for TRUE filter. --- src/test/cc/wfa/virtual_people/common/field_filter/BUILD.bazel | 2 +- .../wfa/virtual_people/common/field_filter/true_filter_test.cc | 3 ++- .../common/field_filter/utils/field_util_test.cc | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/cc/wfa/virtual_people/common/field_filter/BUILD.bazel b/src/test/cc/wfa/virtual_people/common/field_filter/BUILD.bazel index de62a4f..f408d72 100644 --- a/src/test/cc/wfa/virtual_people/common/field_filter/BUILD.bazel +++ b/src/test/cc/wfa/virtual_people/common/field_filter/BUILD.bazel @@ -122,7 +122,7 @@ cc_test( cc_test( name = "true_filter_test", - srcs = ["and_filter_test.cc"], + srcs = ["true_filter_test.cc"], deps = [ "//src/main/cc/wfa/virtual_people/common/field_filter", "//src/main/proto/wfa/virtual_people/common:field_filter_cc_proto", diff --git a/src/test/cc/wfa/virtual_people/common/field_filter/true_filter_test.cc b/src/test/cc/wfa/virtual_people/common/field_filter/true_filter_test.cc index 794a0f3..e0e330b 100644 --- a/src/test/cc/wfa/virtual_people/common/field_filter/true_filter_test.cc +++ b/src/test/cc/wfa/virtual_people/common/field_filter/true_filter_test.cc @@ -27,6 +27,7 @@ namespace wfa_virtual_people { namespace { using ::wfa::StatusIs; +using ::wfa_virtual_people::test::TestProto; TEST(TrueFilterTest, TestIsMatch) { FieldFilterProto field_filter_proto; @@ -47,7 +48,7 @@ TEST(TrueFilterTest, TestIsMatchNotEmptyEvent) { FieldFilter::New(TestProto().GetDescriptor(), field_filter_proto)); TestProto test_proto; - test_proto.set_person_country_code("COUNTRY_1"); + test_proto.mutable_a()->mutable_b()->set_string_value("a"); EXPECT_TRUE(field_filter->IsMatch(test_proto)); } diff --git a/src/test/cc/wfa/virtual_people/common/field_filter/utils/field_util_test.cc b/src/test/cc/wfa/virtual_people/common/field_filter/utils/field_util_test.cc index f79fbca..76ecb5f 100644 --- a/src/test/cc/wfa/virtual_people/common/field_filter/utils/field_util_test.cc +++ b/src/test/cc/wfa/virtual_people/common/field_filter/utils/field_util_test.cc @@ -34,7 +34,6 @@ using ::google::protobuf::Message; using ::testing::FieldsAre; using ::wfa::EqualsProto; using ::wfa::IsOk; -using ::wfa::IsOkAndHolds; using ::wfa::StatusIs; using ::wfa_virtual_people::test::TestProto; using ::wfa_virtual_people::test::TestProtoB;