Skip to content

Commit 7972392

Browse files
authored
Reformat FppTest (#4048)
1 parent d6cd606 commit 7972392

49 files changed

Lines changed: 2127 additions & 3116 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/format-check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
# Svc is currently listing all but Svc/FpySequencer
3333
CHECKED_DIRS: >-
3434
Drv
35+
FppTestProject
3536
Fw
3637
Os
3738
Svc/ActiveRateGroup

FppTestProject/FppTest/array/ArrayToStringTest.cpp

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
//
1111
// ======================================================================
1212

13+
#include "FppTest/array/AliasOfArrayAliasAc.hpp"
14+
#include "FppTest/array/AliasStringArrayAc.hpp"
1315
#include "FppTest/array/EnumArrayAc.hpp"
1416
#include "FppTest/array/StringArrayAc.hpp"
1517
#include "FppTest/array/StructArrayAc.hpp"
1618
#include "FppTest/array/Uint32ArrayArrayAc.hpp"
17-
#include "FppTest/array/AliasOfArrayAliasAc.hpp"
18-
#include "FppTest/array/AliasStringArrayAc.hpp"
1919

2020
#include "FppTest/typed_tests/ArrayTest.hpp"
2121

@@ -26,22 +26,13 @@
2626
// Test array string functions
2727
template <typename ArrayType>
2828
class ArrayToStringTest : public ::testing::Test {
29-
protected:
30-
void SetUp() override {
31-
FppTest::Array::setTestVals<ArrayType>(testVals);
32-
}
29+
protected:
30+
void SetUp() override { FppTest::Array::setTestVals<ArrayType>(testVals); }
3331

3432
typename ArrayType::ElementType testVals[ArrayType::SIZE];
3533
};
3634

37-
using ArrayTypes = ::testing::Types<
38-
Enum,
39-
String,
40-
Struct,
41-
Uint32Array,
42-
AliasString,
43-
AliasOfArray
44-
>;
35+
using ArrayTypes = ::testing::Types<Enum, String, Struct, Uint32Array, AliasString, AliasOfArray>;
4536
TYPED_TEST_SUITE(ArrayToStringTest, ArrayTypes);
4637

4738
// Test array toString() and ostream operator functions
@@ -60,8 +51,5 @@ TYPED_TEST(ArrayToStringTest, ToString) {
6051
}
6152
buf2 << " ]";
6253

63-
ASSERT_STREQ(
64-
buf1.str().c_str(),
65-
buf2.str().c_str()
66-
);
54+
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
6755
}

FppTestProject/FppTest/array/FormatTest.cpp

Lines changed: 30 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@
2828

2929
#include "gtest/gtest.h"
3030

31-
#include <sstream>
3231
#include <limits>
32+
#include <sstream>
3333

3434
// Tests FPP format strings
3535
class FormatTest : public ::testing::Test {
36-
protected:
37-
void SetUp() override {
38-
buf2 << "[ ";
39-
}
36+
protected:
37+
void SetUp() override { buf2 << "[ "; }
4038

4139
std::stringstream buf1, buf2;
4240
};
@@ -54,10 +52,7 @@ TEST_F(FormatTest, Bool) {
5452
}
5553
buf2 << " ]";
5654

57-
ASSERT_STREQ(
58-
buf1.str().c_str(),
59-
buf2.str().c_str()
60-
);
55+
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
6156
}
6257

6358
TEST_F(FormatTest, U8) {
@@ -73,16 +68,13 @@ TEST_F(FormatTest, U8) {
7368
}
7469
buf2 << " ]";
7570

76-
ASSERT_STREQ(
77-
buf1.str().c_str(),
78-
buf2.str().c_str()
79-
);
71+
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
8072
}
8173

8274
TEST_F(FormatTest, U16Dec) {
8375
U16 testVals[FormatU16Dec::SIZE] = {0, 100, std::numeric_limits<U16>::max()};
8476
FormatU16Dec a(testVals);
85-
77+
8678
buf1 << a;
8779
for (U32 i = 0; i < FormatU16Dec::SIZE; i++) {
8880
if (i > 0) {
@@ -92,16 +84,13 @@ TEST_F(FormatTest, U16Dec) {
9284
}
9385
buf2 << " ]";
9486

95-
ASSERT_STREQ(
96-
buf1.str().c_str(),
97-
buf2.str().c_str()
98-
);
87+
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
9988
}
10089

10190
TEST_F(FormatTest, U32Oct) {
10291
U32 testVals[FormatU32Oct::SIZE] = {0, 100, std::numeric_limits<U32>::max()};
10392
FormatU32Oct a(testVals);
104-
93+
10594
buf1 << a;
10695
for (U32 i = 0; i < FormatU32Oct::SIZE; i++) {
10796
if (i > 0) {
@@ -111,17 +100,13 @@ TEST_F(FormatTest, U32Oct) {
111100
}
112101
buf2 << " ]";
113102

114-
ASSERT_STREQ(
115-
buf1.str().c_str(),
116-
buf2.str().c_str()
117-
);
103+
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
118104
}
119105

120106
TEST_F(FormatTest, U64Hex) {
121-
U64 testVals[FormatU64Hex::SIZE] =
122-
{0, 100, std::numeric_limits<U64>::max()};
107+
U64 testVals[FormatU64Hex::SIZE] = {0, 100, std::numeric_limits<U64>::max()};
123108
FormatU64Hex a(testVals);
124-
109+
125110
buf1 << a;
126111
for (U32 i = 0; i < FormatU64Hex::SIZE; i++) {
127112
if (i > 0) {
@@ -131,15 +116,11 @@ TEST_F(FormatTest, U64Hex) {
131116
}
132117
buf2 << " ]";
133118

134-
ASSERT_STREQ(
135-
buf1.str().c_str(),
136-
buf2.str().c_str()
137-
);
119+
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
138120
}
139121

140122
TEST_F(FormatTest, I8) {
141-
I8 testVals[FormatI8::SIZE] =
142-
{std::numeric_limits<I8>::min(), 0, std::numeric_limits<I8>::max()};
123+
I8 testVals[FormatI8::SIZE] = {std::numeric_limits<I8>::min(), 0, std::numeric_limits<I8>::max()};
143124
FormatI8 a(testVals);
144125

145126
buf1 << a;
@@ -151,15 +132,11 @@ TEST_F(FormatTest, I8) {
151132
}
152133
buf2 << " ]";
153134

154-
ASSERT_STREQ(
155-
buf1.str().c_str(),
156-
buf2.str().c_str()
157-
);
135+
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
158136
}
159137

160138
TEST_F(FormatTest, I16Dec) {
161-
I16 testVals[FormatI16Dec::SIZE] =
162-
{std::numeric_limits<I16>::min(), 0, std::numeric_limits<I16>::max()};
139+
I16 testVals[FormatI16Dec::SIZE] = {std::numeric_limits<I16>::min(), 0, std::numeric_limits<I16>::max()};
163140
FormatI16Dec a(testVals);
164141

165142
buf1 << a;
@@ -171,15 +148,11 @@ TEST_F(FormatTest, I16Dec) {
171148
}
172149
buf2 << " ]";
173150

174-
ASSERT_STREQ(
175-
buf1.str().c_str(),
176-
buf2.str().c_str()
177-
);
151+
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
178152
}
179153

180154
TEST_F(FormatTest, I32Oct) {
181-
I32 testVals[FormatI32Oct::SIZE] =
182-
{std::numeric_limits<I32>::min(), 0, std::numeric_limits<I32>::max()};
155+
I32 testVals[FormatI32Oct::SIZE] = {std::numeric_limits<I32>::min(), 0, std::numeric_limits<I32>::max()};
183156
FormatI32Oct a(testVals);
184157

185158
buf1 << a;
@@ -191,16 +164,11 @@ TEST_F(FormatTest, I32Oct) {
191164
}
192165
buf2 << " ]";
193166

194-
ASSERT_STREQ(
195-
buf1.str().c_str(),
196-
buf2.str().c_str()
197-
);
198-
167+
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
199168
}
200169

201170
TEST_F(FormatTest, I64Hex) {
202-
I64 testVals[FormatI64Hex::SIZE] =
203-
{std::numeric_limits<I64>::min(), 0, std::numeric_limits<I64>::max()};
171+
I64 testVals[FormatI64Hex::SIZE] = {std::numeric_limits<I64>::min(), 0, std::numeric_limits<I64>::max()};
204172
FormatI64Hex a(testVals);
205173

206174
buf1 << a;
@@ -212,15 +180,11 @@ TEST_F(FormatTest, I64Hex) {
212180
}
213181
buf2 << " ]";
214182

215-
ASSERT_STREQ(
216-
buf1.str().c_str(),
217-
buf2.str().c_str()
218-
);
183+
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
219184
}
220185

221186
TEST_F(FormatTest, F32E) {
222-
F32 testVals[FormatF32e::SIZE] =
223-
{std::numeric_limits<F32>::min(), 0.0, std::numeric_limits<F32>::max()};
187+
F32 testVals[FormatF32e::SIZE] = {std::numeric_limits<F32>::min(), 0.0, std::numeric_limits<F32>::max()};
224188
FormatF32e a(testVals);
225189

226190
buf1 << a;
@@ -232,15 +196,11 @@ TEST_F(FormatTest, F32E) {
232196
}
233197
buf2 << " ]";
234198

235-
ASSERT_STREQ(
236-
buf1.str().c_str(),
237-
buf2.str().c_str()
238-
);
199+
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
239200
}
240201

241202
TEST_F(FormatTest, F32F) {
242-
F32 testVals[FormatF32f::SIZE] =
243-
{std::numeric_limits<F32>::min(), 0.0, std::numeric_limits<F32>::max()};
203+
F32 testVals[FormatF32f::SIZE] = {std::numeric_limits<F32>::min(), 0.0, std::numeric_limits<F32>::max()};
244204
FormatF32f a(testVals);
245205

246206
buf1 << a;
@@ -252,15 +212,11 @@ TEST_F(FormatTest, F32F) {
252212
}
253213
buf2 << " ]";
254214

255-
ASSERT_STREQ(
256-
buf1.str().c_str(),
257-
buf2.str().c_str()
258-
);
215+
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
259216
}
260217

261218
TEST_F(FormatTest, F64G) {
262-
F64 testVals[FormatF64g::SIZE] =
263-
{std::numeric_limits<F64>::min(), 0.0, std::numeric_limits<F64>::max()};
219+
F64 testVals[FormatF64g::SIZE] = {std::numeric_limits<F64>::min(), 0.0, std::numeric_limits<F64>::max()};
264220
FormatF64g a(testVals);
265221

266222
buf1 << a;
@@ -272,10 +228,7 @@ TEST_F(FormatTest, F64G) {
272228
}
273229
buf2 << " ]";
274230

275-
ASSERT_STREQ(
276-
buf1.str().c_str(),
277-
buf2.str().c_str()
278-
);
231+
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
279232
}
280233

281234
TEST_F(FormatTest, String) {
@@ -297,15 +250,12 @@ TEST_F(FormatTest, String) {
297250
}
298251
buf2 << " ]";
299252

300-
ASSERT_STREQ(
301-
buf1.str().c_str(),
302-
buf2.str().c_str()
303-
);
253+
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
304254
}
305255

306256
TEST_F(FormatTest, Char) {
307-
U8 testVals[FormatChar::SIZE] =
308-
{FppTest::Utils::getNonzeroU8(), FppTest::Utils::getNonzeroU8(), FppTest::Utils::getNonzeroU8()};
257+
U8 testVals[FormatChar::SIZE] = {FppTest::Utils::getNonzeroU8(), FppTest::Utils::getNonzeroU8(),
258+
FppTest::Utils::getNonzeroU8()};
309259
FormatChar a(testVals);
310260

311261
buf1 << a;
@@ -317,8 +267,5 @@ TEST_F(FormatTest, Char) {
317267
}
318268
buf2 << " ]";
319269

320-
ASSERT_STREQ(
321-
buf1.str().c_str(),
322-
buf2.str().c_str()
323-
);
270+
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
324271
}

0 commit comments

Comments
 (0)