diff --git a/tensorflow_federated/cc/core/impl/aggregation/core/BUILD b/tensorflow_federated/cc/core/impl/aggregation/core/BUILD index 335fd73e3a..f168731955 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/core/BUILD +++ b/tensorflow_federated/cc/core/impl/aggregation/core/BUILD @@ -82,6 +82,7 @@ cc_library( ":tensor_cc_proto", "//tensorflow_federated/cc/core/impl/aggregation/base", "@com_google_absl//absl/strings", + "@com_google_absl//absl/strings:string_view", "@com_google_absl//absl/types:span", ], ) diff --git a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/BUILD b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/BUILD index d5b3eb12b4..9fdc5fadd7 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/BUILD +++ b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/BUILD @@ -29,6 +29,7 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_absl//absl/strings:string_view", "@org_tensorflow//tensorflow/core:framework", "@org_tensorflow//tensorflow/core:protos_all_cc", "@org_tensorflow//tensorflow/core/platform:tstring", @@ -87,6 +88,7 @@ cc_test( "//tensorflow_federated/cc/testing:oss_test_main", "//tensorflow_federated/cc/testing:status_matchers", "@com_google_absl//absl/strings", + "@com_google_absl//absl/strings:string_view", ], ) diff --git a/tensorflow_federated/cc/core/impl/aggregation/testing/BUILD b/tensorflow_federated/cc/core/impl/aggregation/testing/BUILD index 7dc6a85d74..324986b3e8 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/testing/BUILD +++ b/tensorflow_federated/cc/core/impl/aggregation/testing/BUILD @@ -34,6 +34,7 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:cord", + "@com_google_absl//absl/strings:string_view", "@org_tensorflow//tensorflow/c:checkpoint_reader", "@org_tensorflow//tensorflow/c:tf_status_headers", "@org_tensorflow//tensorflow/c:tf_status_helper", diff --git a/tensorflow_federated/cc/testing/BUILD b/tensorflow_federated/cc/testing/BUILD index 55c32c0e4d..aa37e73ce3 100644 --- a/tensorflow_federated/cc/testing/BUILD +++ b/tensorflow_federated/cc/testing/BUILD @@ -35,6 +35,7 @@ cc_library( "@com_google_absl//absl/memory", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", + "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest", ], ) @@ -49,6 +50,7 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest", ], ) diff --git a/tensorflow_federated/cc/testing/protobuf_matchers.h b/tensorflow_federated/cc/testing/protobuf_matchers.h index d4f29efa94..ae45575f06 100644 --- a/tensorflow_federated/cc/testing/protobuf_matchers.h +++ b/tensorflow_federated/cc/testing/protobuf_matchers.h @@ -39,10 +39,11 @@ #include #include #include -#include #include #include +#include "absl/strings/string_view.h" + #include "google/protobuf/message.h" #include "google/protobuf/text_format.h" #include "google/protobuf/util/message_differencer.h" @@ -253,7 +254,7 @@ class ProtoMatcher : public ProtoMatcherBase { // as a (text format) string. class ProtoStringMatcher : public ProtoMatcherBase { public: - explicit ProtoStringMatcher(std::string_view expected) + explicit ProtoStringMatcher(absl::string_view expected) : expected_(expected) {} private: @@ -318,7 +319,7 @@ inline ::testing::PolymorphicMatcher EqualsProto( return ::testing::MakePolymorphicMatcher(internal_proto::ProtoMatcher(x)); } inline ::testing::PolymorphicMatcher -EqualsProto(std::string_view x) { +EqualsProto(absl::string_view x) { return ::testing::MakePolymorphicMatcher( internal_proto::ProtoStringMatcher(x)); } diff --git a/tensorflow_federated/cc/testing/status_matchers.cc b/tensorflow_federated/cc/testing/status_matchers.cc index ec8ab5de76..fcaed4e722 100644 --- a/tensorflow_federated/cc/testing/status_matchers.cc +++ b/tensorflow_federated/cc/testing/status_matchers.cc @@ -18,11 +18,11 @@ limitations under the License #include #include #include -#include #include "googletest/include/gtest/gtest.h" #include "absl/status/status.h" #include "absl/strings/str_cat.h" +#include "absl/strings/string_view.h" namespace tensorflow_federated { namespace internal_status { @@ -94,7 +94,7 @@ bool CanonicalStatusIsMatcherCommonImpl::MatchAndExplain( return true; } -void AddFatalFailure(std::string_view expression, const char* file, +void AddFatalFailure(absl::string_view expression, const char* file, uint32_t line, absl::Status status) { GTEST_MESSAGE_AT_( file, line, diff --git a/tensorflow_federated/cc/testing/status_matchers.h b/tensorflow_federated/cc/testing/status_matchers.h index c20ca5e9d2..aae5060065 100644 --- a/tensorflow_federated/cc/testing/status_matchers.h +++ b/tensorflow_federated/cc/testing/status_matchers.h @@ -22,7 +22,6 @@ limitations under the License #include #include #include -#include #include #include @@ -30,6 +29,7 @@ limitations under the License #include "googletest/include/gtest/gtest.h" #include "absl/status/status.h" #include "absl/status/statusor.h" +#include "absl/strings/string_view.h" #include "include/grpcpp/support/status.h" namespace tensorflow_federated { @@ -290,7 +290,7 @@ class IsOkMatcher { } }; -void AddFatalFailure(std::string_view expression, const char* file, +void AddFatalFailure(absl::string_view expression, const char* file, uint32_t line, absl::Status status); inline absl::Status GetStatus(absl::Status&& status) { return status; }