13#include "FppTest/array/FormatBoolArrayAc.hpp"
14#include "FppTest/array/FormatU8ArrayAc.hpp"
15#include "FppTest/array/FormatU16DecArrayAc.hpp"
16#include "FppTest/array/FormatU32OctArrayAc.hpp"
17#include "FppTest/array/FormatU64HexArrayAc.hpp"
18#include "FppTest/array/FormatI8ArrayAc.hpp"
19#include "FppTest/array/FormatI16DecArrayAc.hpp"
20#include "FppTest/array/FormatI32OctArrayAc.hpp"
21#include "FppTest/array/FormatI64HexArrayAc.hpp"
22#include "FppTest/array/FormatF32eArrayAc.hpp"
23#include "FppTest/array/FormatF32fArrayAc.hpp"
24#include "FppTest/array/FormatF64gArrayAc.hpp"
25#include "FppTest/array/FormatStringArrayAc.hpp"
26#include "FppTest/array/FormatCharArrayAc.hpp"
29#include "gtest/gtest.h"
45 bool testVals[FormatBool::SIZE] = {
true,
true,
false};
46 FormatBool a(testVals);
49 for (U32 i = 0; i < FormatBool::SIZE; i++) {
50 buf2 <<
"a " << testVals[i] <<
" b ";
61 U8 testVals[FormatU8::SIZE] = {0, 100, std::numeric_limits<U8>::max()};
65 for (U32 i = 0; i < FormatU8::SIZE; i++) {
66 buf2 <<
"a " << (U16) testVals[i] <<
" b ";
77 U16 testVals[FormatU16Dec::SIZE] = {0, 100, std::numeric_limits<U16>::max()};
78 FormatU16Dec a(testVals);
81 for (U32 i = 0; i < FormatU16Dec::SIZE; i++) {
82 buf2 <<
"a " << std::dec << testVals[i] <<
" b ";
93 U32 testVals[FormatU32Oct::SIZE] = {0, 100, std::numeric_limits<U32>::max()};
94 FormatU32Oct a(testVals);
97 for (U32 i = 0; i < FormatU32Oct::SIZE; i++) {
98 buf2 <<
"a " << std::oct << testVals[i] <<
" b ";
109 U64 testVals[FormatU64Hex::SIZE] =
110 {0, 100, std::numeric_limits<U64>::max()};
111 FormatU64Hex a(testVals);
114 for (U32 i = 0; i < FormatU64Hex::SIZE; i++) {
115 buf2 <<
"a " << std::hex << testVals[i] <<
" b ";
126 I8 testVals[FormatI8::SIZE] =
127 {std::numeric_limits<I8>::min(), 0, std::numeric_limits<I8>::max()};
128 FormatI8 a(testVals);
131 for (U32 i = 0; i < FormatI8::SIZE; i++) {
132 buf2 <<
"a " << (I16) testVals[i] <<
" b ";
143 I16 testVals[FormatI16Dec::SIZE] =
144 {std::numeric_limits<I16>::min(), 0, std::numeric_limits<I16>::max()};
145 FormatI16Dec a(testVals);
148 for (U32 i = 0; i < FormatI16Dec::SIZE; i++) {
149 buf2 <<
"a " << std::dec << testVals[i] <<
" b ";
160 I32 testVals[FormatI32Oct::SIZE] =
161 {std::numeric_limits<I32>::min(), 0, std::numeric_limits<I32>::max()};
162 FormatI32Oct a(testVals);
165 for (U32 i = 0; i < FormatI32Oct::SIZE; i++) {
166 buf2 <<
"a " << std::oct << testVals[i] <<
" b ";
178 I64 testVals[FormatI64Hex::SIZE] =
179 {std::numeric_limits<I64>::min(), 0, std::numeric_limits<I64>::max()};
180 FormatI64Hex a(testVals);
183 for (U32 i = 0; i < FormatI64Hex::SIZE; i++) {
184 buf2 <<
"a " << std::hex << testVals[i] <<
" b ";
195 F32 testVals[FormatF32e::SIZE] =
196 {std::numeric_limits<F32>::min(), 0.0, std::numeric_limits<F32>::max()};
197 FormatF32e a(testVals);
200 for (U32 i = 0; i < FormatF32e::SIZE; i++) {
201 buf2 <<
"a " << std::setprecision(1) << std::scientific << testVals[i] <<
" b ";
212 F32 testVals[FormatF32f::SIZE] =
213 {std::numeric_limits<F32>::min(), 0.0, std::numeric_limits<F32>::max()};
214 FormatF32f a(testVals);
217 for (U32 i = 0; i < FormatF32f::SIZE; i++) {
218 buf2 <<
"a " << std::setprecision(2) << std::fixed << testVals[i] <<
" b ";
229 F64 testVals[FormatF64g::SIZE] =
230 {std::numeric_limits<F64>::min(), 0.0, std::numeric_limits<F64>::max()};
231 FormatF64g a(testVals);
234 for (U32 i = 0; i < FormatF64g::SIZE; i++) {
235 buf2 <<
"a " << std::setprecision(3) << testVals[i] <<
" b ";
246 FormatString::StringSize80 testVals[FormatString::SIZE];
248 for (U32 i = 0; i < FormatString::SIZE; i++) {
253 FormatString a(testVals);
256 for (U32 i = 0; i < FormatString::SIZE; i++) {
257 buf2 <<
"% " << testVals[i].toChar() <<
" ";
268 U8 testVals[FormatChar::SIZE] =
270 FormatChar a(testVals);
273 for (U32 i = 0; i < FormatChar::SIZE; i++) {
274 buf2 <<
"a " << testVals[i] <<
" b ";
int8_t I8
8-bit signed integer
float F32
32-bit floating point
uint8_t U8
8-bit unsigned integer
void setString(char *buf, U32 size)