fsfw/src/fsfw_tests/internal/globalfunctions/TestArrayPrinter.cpp

29 lines
1.0 KiB
C++
Raw Normal View History

2021-08-02 20:58:56 +02:00
#include "fsfw_tests/internal/globalfunctions/TestArrayPrinter.h"
2021-01-15 16:56:36 +01:00
void arrayprinter::testArrayPrinter() {
2022-02-02 10:29:30 +01:00
{
const std::array<uint8_t, 5> testDataSmall = {0x01, 0x02, 0x03, 0x04, 0x05};
arrayprinter::print(testDataSmall.data(), testDataSmall.size());
arrayprinter::print(testDataSmall.data(), testDataSmall.size(), OutputType::DEC);
arrayprinter::print(testDataSmall.data(), testDataSmall.size(), OutputType::BIN);
}
2021-01-15 18:07:32 +01:00
2022-02-02 10:29:30 +01:00
{
std::array<uint8_t, 16> testDataMed;
for (size_t idx = 0; idx < testDataMed.size(); idx++) {
testDataMed[idx] = testDataMed.size() - idx;
2021-01-15 18:07:32 +01:00
}
2022-02-02 10:29:30 +01:00
arrayprinter::print(testDataMed.data(), testDataMed.size());
arrayprinter::print(testDataMed.data(), testDataMed.size(), OutputType::DEC, 8);
}
2021-01-15 18:07:32 +01:00
2022-02-02 10:29:30 +01:00
{
std::array<uint8_t, 32> testDataLarge;
for (size_t idx = 0; idx < testDataLarge.size(); idx++) {
testDataLarge[idx] = idx;
2021-01-15 18:07:32 +01:00
}
2022-02-02 10:29:30 +01:00
arrayprinter::print(testDataLarge.data(), testDataLarge.size());
arrayprinter::print(testDataLarge.data(), testDataLarge.size(), OutputType::DEC);
}
2021-01-15 16:56:36 +01:00
}