aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt3
-rw-r--r--test/ExampleTest.cpp10
-rw-r--r--test/pbdrv/main.cpp18
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);
+}
+