pw_rpc: Make MethodType public
- MethodType will be used in testing APIs and is harmless to have be
public. Move it from pw::rpc::internal to pw::rpc.
- Add HasServerStream and HasClientStream functions that check if a
MethodType includes server or client streaming components.
- Add method_test to cover the generic Method class and the MethodType
enum.
Change-Id: I66365071a1ff42d5308adb3065fc14ee5f71d36b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/56980
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Keir Mierle <keir@google.com>
diff --git a/pw_rpc/BUILD.gn b/pw_rpc/BUILD.gn
index f83d498..1302c10 100644
--- a/pw_rpc/BUILD.gn
+++ b/pw_rpc/BUILD.gn
@@ -112,8 +112,8 @@
"channel.cc",
"packet.cc",
"public/pw_rpc/internal/channel.h",
- "public/pw_rpc/internal/method_type.h",
"public/pw_rpc/internal/packet.h",
+ "public/pw_rpc/method_type.h",
]
friend = [ "./*" ]
}
@@ -230,6 +230,7 @@
":channel_test",
":client_test",
":client_server_test",
+ ":method_test",
":ids_test",
":packet_test",
":responder_test",
@@ -326,6 +327,14 @@
sources = [ "base_client_call_test.cc" ]
}
+pw_test("method_test") {
+ deps = [
+ ":server",
+ ":test_utils",
+ ]
+ sources = [ "method_test.cc" ]
+}
+
pw_test("server_test") {
deps = [
":protos.pwpb",