summaryrefslogtreecommitdiff
path: root/quantum/serial_link/tests/triple_buffered_object_tests.cpp
diff options
context:
space:
mode:
authorskullY <skullydazed@gmail.com>2019-08-30 11:19:03 -0700
committerFlorian Didron <fdidron@users.noreply.github.com>2019-09-17 11:39:43 +0900
commitf8fe33acfac01064112fd2b5da680abfb5190b97 (patch)
treefcf75ef930800a948e5a3ba015d6759889f2284d /quantum/serial_link/tests/triple_buffered_object_tests.cpp
parentc339d670684674165b422a0168bfd2016ff2e6ef (diff)
clang-format changes
Diffstat (limited to 'quantum/serial_link/tests/triple_buffered_object_tests.cpp')
-rw-r--r--quantum/serial_link/tests/triple_buffered_object_tests.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/quantum/serial_link/tests/triple_buffered_object_tests.cpp b/quantum/serial_link/tests/triple_buffered_object_tests.cpp
index 7724bbee9c..8de9bfdebf 100644
--- a/quantum/serial_link/tests/triple_buffered_object_tests.cpp
+++ b/quantum/serial_link/tests/triple_buffered_object_tests.cpp
@@ -27,18 +27,16 @@ extern "C" {
#include "serial_link/protocol/triple_buffered_object.h"
}
-struct test_object{
- uint8_t state;
+struct test_object {
+ uint8_t state;
uint32_t buffer[3];
};
test_object test_object;
class TripleBufferedObject : public testing::Test {
-public:
- TripleBufferedObject() {
- triple_buffer_init((triple_buffer_object_t*)&test_object);
- }
+ public:
+ TripleBufferedObject() { triple_buffer_init((triple_buffer_object_t*)&test_object); }
};
TEST_F(TripleBufferedObject, writes_and_reads_object) {
@@ -47,9 +45,7 @@ TEST_F(TripleBufferedObject, writes_and_reads_object) {
EXPECT_EQ(*triple_buffer_read(&test_object), 0x3456ABCC);
}
-TEST_F(TripleBufferedObject, does_not_read_empty) {
- EXPECT_EQ(triple_buffer_read(&test_object), nullptr);
-}
+TEST_F(TripleBufferedObject, does_not_read_empty) { EXPECT_EQ(triple_buffer_read(&test_object), nullptr); }
TEST_F(TripleBufferedObject, writes_twice_and_reads_object) {
*triple_buffer_begin_write(&test_object) = 0x3456ABCC;
@@ -62,7 +58,7 @@ TEST_F(TripleBufferedObject, writes_twice_and_reads_object) {
TEST_F(TripleBufferedObject, performs_another_write_in_the_middle_of_read) {
*triple_buffer_begin_write(&test_object) = 1;
triple_buffer_end_write(&test_object);
- uint32_t* read = triple_buffer_read(&test_object);
+ uint32_t* read = triple_buffer_read(&test_object);
*triple_buffer_begin_write(&test_object) = 2;
triple_buffer_end_write(&test_object);
EXPECT_EQ(*read, 1);
@@ -73,7 +69,7 @@ TEST_F(TripleBufferedObject, performs_another_write_in_the_middle_of_read) {
TEST_F(TripleBufferedObject, performs_two_writes_in_the_middle_of_read) {
*triple_buffer_begin_write(&test_object) = 1;
triple_buffer_end_write(&test_object);
- uint32_t* read = triple_buffer_read(&test_object);
+ uint32_t* read = triple_buffer_read(&test_object);
*triple_buffer_begin_write(&test_object) = 2;
triple_buffer_end_write(&test_object);
*triple_buffer_begin_write(&test_object) = 3;