2828
2929#include " gtest/gtest.h"
3030
31- #include < sstream>
3231#include < limits>
32+ #include < sstream>
3333
3434// Tests FPP format strings
3535class 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
6358TEST_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
8274TEST_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
10190TEST_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
120106TEST_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
140122TEST_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
160138TEST_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
180154TEST_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
201170TEST_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
221186TEST_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
241202TEST_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
261218TEST_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
281234TEST_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
306256TEST_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