Parker Schuh | 149161a | 2016-03-16 21:57:21 -0700 | [diff] [blame] | 1 | #include "gtest/gtest.h" |
| 2 | |
| 3 | #include "aos/common/logging/logging.h" |
| 4 | #include "aos/protobuf/stack_arena.h" |
| 5 | #include "aos/testing/test_logging.h" |
| 6 | |
| 7 | namespace aos { |
| 8 | namespace protobuf { |
| 9 | namespace { |
| 10 | |
| 11 | struct TestStruct { |
| 12 | int a; |
| 13 | int b; |
| 14 | int c; |
| 15 | }; |
| 16 | |
| 17 | class StackProtoArenaTest : public ::testing::Test {}; |
| 18 | |
| 19 | TEST_F(StackProtoArenaTest, Basic) { |
| 20 | ::aos::testing::EnableTestLogging(); |
| 21 | StackProtoArena<164> stack_arena; |
| 22 | |
| 23 | TestStruct* msg = |
| 24 | google::protobuf::Arena::Create<TestStruct>(stack_arena.arena()); |
| 25 | CHECK_NOTNULL(msg); |
| 26 | } |
| 27 | |
| 28 | } // namespace |
| 29 | } // namespace protobuf |
| 30 | } // namespace aos |