diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-06-05 17:44:57 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-06-05 17:44:57 +0200 |
commit | 0fc049aeaf3dab41e92ed0bd7872094d7c5c9bdc (patch) | |
tree | c96ed327f4fedaa95937b1c4dd6bf53d12aa4ecc /test | |
parent | 68471e5800b81285453a26547721d264dbcf49b9 (diff) |
WIP pb-write cmd req set state
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 3 | ||||
-rw-r--r-- | test/ExampleTest.cpp | 10 | ||||
-rw-r--r-- | test/pbdrv/main.cpp | 18 |
3 files changed, 19 insertions, 12 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 818c533..d5d6e0d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,15 +7,14 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS 1) project(pbtest C CXX ASM) add_executable(test - ExampleTest.cpp i2ctcp/main.cpp + pbdrv/main.cpp ) add_subdirectory(lib/googletest) add_subdirectory(lib/pbdrv) add_subdirectory(lib/i2ctcp) -# target_include_directories(tests PRIVATE ${CMAKE_CURRENT_LIST_DIR}) target_link_libraries(test gtest_main i2ctcp diff --git a/test/ExampleTest.cpp b/test/ExampleTest.cpp deleted file mode 100644 index 3da58ff..0000000 --- a/test/ExampleTest.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include <gtest/gtest.h> - -class ExampleTest : public testing::Test { -protected: -}; - -TEST_F(ExampleTest, Test) { - EXPECT_EQ(5, 5); -} - diff --git a/test/pbdrv/main.cpp b/test/pbdrv/main.cpp new file mode 100644 index 0000000..de7e88a --- /dev/null +++ b/test/pbdrv/main.cpp @@ -0,0 +1,18 @@ +#include <gtest/gtest.h> + +#include "pb-write.h" + +TEST(pbdrv, write) { + + pbdrv_buf_t buf = pbdrv_write_cmd_req_set_state({ + .header = { .sender = 0xf0, }, + .state = PB_GS_PLAYING, + }); + for (size_t i = 0; i < buf.size; i++) { + printf("%02x ", buf.data[i] & 0xff); + } + printf("\n"); + + ASSERT_TRUE(true); +} + |