aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Jang <josephjang@google.com>2022-12-27 10:46:24 +0000
committerJoseph Jang <josephjang@google.com>2022-12-28 02:04:24 +0000
commit252b7431b60052499cc17e5fc3d66cf99ac50a2d (patch)
tree15fbebd1135a6bb3d3a1507c342c553ed8913ea7
parent9a2e12b07d3279ffca0767912e3f2167f32257d8 (diff)
downloadgeneric-252b7431b60052499cc17e5fc3d66cf99ac50a2d.tar.gz
MockNuggetClient: Fix build break by adding new CallApp mock method
Bug: 263756493 Change-Id: I8316e3860ccdf2d5ceaa9ab01d312e6e40ab11d7 Reviewed-on: https://nugget-os-review.googlesource.com/c/host/generic/+/56324 Tested-by: Joseph Jang <josephjang@google.com> Reviewed-by: Tommy Chiu <tommychiu@google.com> Presubmit-Verified: Android Build Prod User <android-build-prod@system.gserviceaccount.com>
-rw-r--r--libnos/generator/test/test.cpp4
-rw-r--r--libnos/test/include/nos/MockNuggetClient.h3
2 files changed, 5 insertions, 2 deletions
diff --git a/libnos/generator/test/test.cpp b/libnos/generator/test/test.cpp
index 4542c88..f6a4835 100644
--- a/libnos/generator/test/test.cpp
+++ b/libnos/generator/test/test.cpp
@@ -79,7 +79,7 @@ TEST(GeneratedServiceClientTest, DataSuccessfullyExchanged) {
GreetResponse response;
response.set_greeting("Hello, Tester age 78");
- std::vector<uint8_t> responseBytes(response.ByteSize());
+ std::vector<uint8_t> responseBytes(response.ByteSizeLong());
ASSERT_TRUE(response.SerializeToArray(responseBytes.data(), responseBytes.size()));
EXPECT_CALL(client, CallApp(_, _, DecodesToProtoMessage(request), _))
@@ -114,7 +114,7 @@ TEST(GeneratedServiceClientTest, AppErrorsPropagatedWithoutResponseDecode) {
GreetResponse response;
response.set_greeting("Ignore me");
- std::vector<uint8_t> responseBytes(response.ByteSize());
+ std::vector<uint8_t> responseBytes(response.ByteSizeLong());
ASSERT_TRUE(response.SerializeToArray(responseBytes.data(), responseBytes.size()));
EXPECT_CALL(client, CallApp(_, _, _, _))
diff --git a/libnos/test/include/nos/MockNuggetClient.h b/libnos/test/include/nos/MockNuggetClient.h
index 48814c9..19e7f00 100644
--- a/libnos/test/include/nos/MockNuggetClient.h
+++ b/libnos/test/include/nos/MockNuggetClient.h
@@ -33,6 +33,9 @@ struct MockNuggetClient : public NuggetClientInterface {
MOCK_METHOD4(CallApp, uint32_t(uint32_t, uint16_t,
const std::vector<uint8_t>&,
std::vector<uint8_t>*));
+ MOCK_METHOD6(CallApp, uint32_t(uint32_t, uint16_t,
+ const void*, uint32_t,
+ void*, uint32_t*));
MOCK_CONST_METHOD0(Reset, uint32_t());
};