binarystore: Convert to nanopb
This converts the on BMC code to use nanopb, while keeping the test code
using the standard protobuf impl. This is an effort to reduce code size
for some of our legacy BMCs which requires us to get rid of the standard
protobuf implementation where possible.
Change-Id: I522087820ae437a595c24aebc2086bea8908cfcc
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/test/binarystore_unittest.cpp b/test/binarystore_unittest.cpp
index 8103d6f..fe74a3b 100644
--- a/test/binarystore_unittest.cpp
+++ b/test/binarystore_unittest.cpp
@@ -12,6 +12,8 @@
#include <stdplus/print.hpp>
#include <vector>
+#include "binaryblob.pb.h"
+
#include <gmock/gmock.h>
const std::string blobData = "jW7jiID}kD&gm&Azi:^]JT]'Ov4"
@@ -233,14 +235,3 @@
ASSERT_TRUE(store);
EXPECT_FALSE(store->commit());
}
-
-TEST_F(BinaryStoreTest, TestCreateFromFileExceedMaxSize)
-{
- auto testDataFile = createBlobStorage(inputProto);
- auto store = binstore::BinaryStore::createFromFile(std::move(testDataFile),
- false, 1);
-
- // Reading from File is expected to call loadSerializedData and fail at the
- // commit()
- EXPECT_FALSE(store);
-}
diff --git a/test/handler_unittest.hpp b/test/handler_unittest.hpp
index 63e14c6..90b8e4a 100644
--- a/test/handler_unittest.hpp
+++ b/test/handler_unittest.hpp
@@ -7,8 +7,6 @@
#include <memory>
#include <string>
-#include "binaryblob.pb.h"
-
#include <gtest/gtest.h>
using ::testing::Contains;
diff --git a/test/meson.build b/test/meson.build
index fe4c0f2..bb9ff33 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -1,10 +1,6 @@
gtest = dependency('gtest', main: true, disabler: true, required: get_option('tests'))
gmock = dependency('gmock', disabler: true, required: get_option('tests'))
-test_dep = declare_dependency(
- include_directories: include_directories('.'),
- dependencies: [gtest, gmock])
-
tests = [
'binarystore_unittest',
'parse_config_unittest',
@@ -23,5 +19,5 @@
t.underscorify(),
t + '.cpp',
implicit_include_directories: false,
- dependencies: [binarystoreblob_dep, test_dep]))
+ dependencies: [binarystoreblob_dep, binaryblob_proto_dep, gtest, gmock]))
endforeach