aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-06-26 15:44:26 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-06-26 15:44:26 +0200
commitee5d161f6153e1f9da73e477f63f38dcf52ca10c (patch)
tree926413950f64ed7b0f45f6b3551c16446ecd08d4 /test
parentc77d271d9cb86bf6893098ec6c431fc87945e6c9 (diff)
`make format`
Diffstat (limited to 'test')
-rw-r--r--test/i2ctcp/main.cpp11
-rw-r--r--test/pbdrv/mod.c1
-rw-r--r--test/pbdrv/msg.cpp3
-rw-r--r--test/pbdrv/msg.h3
-rw-r--r--test/pbdrv/pb-route.c3
5 files changed, 8 insertions, 13 deletions
diff --git a/test/i2ctcp/main.cpp b/test/i2ctcp/main.cpp
index 1f0c3ff..ca857cd 100644
--- a/test/i2ctcp/main.cpp
+++ b/test/i2ctcp/main.cpp
@@ -5,7 +5,9 @@
using std::min;
-const uint8_t data[] = { 0xff, 0x00, 0xde, 0xad, 0xbe, 0xef, };
+const uint8_t data[] = {
+ 0xff, 0x00, 0xde, 0xad, 0xbe, 0xef,
+};
const size_t data_len = sizeof(data);
const size_t chunk_size = 6;
@@ -33,14 +35,11 @@ TEST(i2ctcp, recv) {
int parsed = i2ctcp_read(&recv_msg, send_data + i, expected_size);
EXPECT_GE(parsed, 0);
- if (i + expected_size == send_size)
- EXPECT_EQ(parsed, 0);
- else
- EXPECT_GT(parsed, 0);
+ if (i + expected_size == send_size) EXPECT_EQ(parsed, 0);
+ else EXPECT_GT(parsed, 0);
}
ASSERT_NE(recv_msg.data, nullptr);
ASSERT_EQ(recv_msg.length, data_len);
ASSERT_EQ(0, memcmp(recv_msg.data, data, data_len));
}
-
diff --git a/test/pbdrv/mod.c b/test/pbdrv/mod.c
index 5c4c95e..e4c2505 100644
--- a/test/pbdrv/mod.c
+++ b/test/pbdrv/mod.c
@@ -9,4 +9,3 @@ const i2c_addr_t PB_MOD_ADDR = 0x08;
void pb_i2c_send(i2c_addr_t addr, const uint8_t * buf, size_t sz) {
printf("[0x%02x]: buf[%lu]\n", addr & 0x7f, sz);
}
-
diff --git a/test/pbdrv/msg.cpp b/test/pbdrv/msg.cpp
index ca23bc7..3847b5f 100644
--- a/test/pbdrv/msg.cpp
+++ b/test/pbdrv/msg.cpp
@@ -1,8 +1,8 @@
#include <gtest/gtest.h>
+#include "pb-mod.h"
#include "pb-msg.h"
#include "pb-send.h"
-#include "pb-mod.h"
TEST(pb_msg_rw, cmd_req_read) {
pb_cmd_prop_t cmd = {
@@ -53,4 +53,3 @@ TEST(pb_msg_rw, cmd_req_magic) {
pb_msg_free(msg_read);
}
-
diff --git a/test/pbdrv/msg.h b/test/pbdrv/msg.h
index 52bee37..73c184e 100644
--- a/test/pbdrv/msg.h
+++ b/test/pbdrv/msg.h
@@ -26,7 +26,6 @@ static const pb_cmd_res_state_t expected_res_state = {
.state = PB_GS_IDLE,
};
-static const pb_cmd_req_set_state_t expected_req_set_state ={
+static const pb_cmd_req_set_state_t expected_req_set_state = {
.state = PB_GS_PLAYING,
};
-
diff --git a/test/pbdrv/pb-route.c b/test/pbdrv/pb-route.c
index 62a4b85..9e0fa30 100644
--- a/test/pbdrv/pb-route.c
+++ b/test/pbdrv/pb-route.c
@@ -1,2 +1 @@
-void pb_mod_blocking_delay_ms(unsigned long ms) { }
-
+void pb_mod_blocking_delay_ms(unsigned long ms) {}