Enable gcc wall and werror.

This commit is contained in:
James Grogan 2023-01-23 11:06:30 +00:00
parent 990cde402b
commit 3fad113178
64 changed files with 347 additions and 314 deletions

View file

@ -22,10 +22,10 @@ TEST_CASE(TestHuffmanCodeLengthTable, "compression")
table.buildCompressedLengthSequence();
auto compressed_sequence = table.getCompressedLengthSequence();
for (auto entry : compressed_sequence)
{
//for (auto entry : compressed_sequence)
//{
// std::cout << "Count " << entry.first << " extra bits " << entry.second << std::endl;
}
//}
auto compressed_lengths = table.getCompressedLengthCounts();
for(unsigned idx = 0; idx<compressed_lengths.size(); idx++)
@ -53,10 +53,10 @@ TEST_CASE(TestLiteralsTable, "compression")
table.buildCompressedLengthSequence();
auto compressed_sequence = table.getCompressedLengthSequence();
for (auto entry : compressed_sequence)
{
//for (auto entry : compressed_sequence)
//{
// std::cout << "Code " << entry.first << " extra bits " << entry.second << std::endl;
}
//}
auto compressed_lengths = table.getCompressedLengthCounts();
for(unsigned idx = 0; idx<compressed_lengths.size(); idx++)

View file

@ -25,11 +25,11 @@ TEST_CASE(TestLz77Encoder, "compression")
encoder.encode();
auto hit_buffer = encoder.getHitBuffer();
for(const auto& hit : hit_buffer)
{
const auto& [length, distance, next_char] = hit;
//for(const auto& hit : hit_buffer)
//{
//const auto& [length, distance, next_char] = hit;
//std::cout << "Got hit " << length << " | " << distance << " | " << static_cast<int>(next_char) << std::endl;
}
//}
HuffmanEncoder huffman_encoder;
huffman_encoder.initializeTrees(hit_buffer);

View file

@ -37,6 +37,7 @@ TEST_CASE(TestReadBitStream, "core")
valid = stream.readNextNBits(3, buffer);
//std::cout << "Slice3 is " << ByteUtils::toString(buffer) << std::endl;
REQUIRE(valid);
}
TEST_CASE(TestWritingBitStream, "core")

View file

@ -14,6 +14,7 @@ TEST_CASE(TestReadByteUtils, "core")
auto slice = ByteUtils::getMBitsAtN(byte, 3, 3);
//std::cout << "Slice is " << ByteUtils::toString(slice) << std::endl;
(void) slice;
uint32_t input {12345678};
auto byte0 = ByteUtils::getByteN(input, 0);
@ -21,6 +22,11 @@ TEST_CASE(TestReadByteUtils, "core")
auto byte2 = ByteUtils::getByteN(input, 2);
auto byte3 = ByteUtils::getByteN(input, 3);
(void)byte0;
(void)byte1;
(void)byte2;
(void)byte3;
//std::cout << "Byte0 is " << ByteUtils::toString(byte0) << std::endl;
//std::cout << "Byte1 is " << ByteUtils::toString(byte1) << std::endl;
//std::cout << "Byte2 is " << ByteUtils::toString(byte2) << std::endl;
@ -28,10 +34,11 @@ TEST_CASE(TestReadByteUtils, "core")
//std::cout << "Mirroring" << std::endl;
auto out = ByteUtils::mirror(byte);
//auto out = ByteUtils::mirror(byte);
//std::cout << "Mirror is " << ByteUtils::toString(out) << std::endl;
unsigned hold = byte;
hold = (hold << 5) + 3;
(void)hold;
//std::cout << "Big val is " << ByteUtils::toString(hold, 16) << std::endl;
}

View file

@ -18,17 +18,20 @@ TEST_CASE(TestCircleBuffer, "core")
{
auto item = buffer.getItem(idx);
//std::cout << "Got item: " << idx << " " << item << std::endl;
(void)item;
}
for (auto item : {4, 5})
{
//std::cout << "Add item: " << item << std::endl;
//buffer.addItem(item);
(void)item;
}
for (std::size_t idx=0; idx<3; idx++)
{
auto item = buffer.getItem(idx);
//std::cout << "Got item: " << idx << " " << item << std::endl;
(void)item;
}
}

View file

@ -12,8 +12,8 @@ TEST_CASE(TestTomlReader, "core")
REQUIRE(themes_table);
for (const auto& items : themes_table->getKeyValuePairs())
{
//for (const auto& items : themes_table->getKeyValuePairs())
//{
//std::cout << "Got entry with key: " << items.first << " and val " << items.second << std::endl;
}
//}
}

View file

@ -16,7 +16,7 @@ int main(int argc, char *argv[])
auto args = CommandLineArgs::Create();
args->process(argc, argv);
auto result = TestCaseRunner::getInstance().run(args->getUserArgs());
TestCaseRunner::getInstance().run(args->getUserArgs());
#ifdef _WIN32
CoUninitialize();

View file

@ -10,9 +10,9 @@ public:
using TestCaseFunction = std::function<void()>;
TestCase(const std::string& name, const std::string& tags, TestCaseFunction func)
: mName(name),
mTags(tags),
mTestFunction(func)
: mTestFunction(func),
mName(name),
mTags(tags)
{
};

View file

@ -47,7 +47,7 @@ int main(int argc, char *argv[])
#endif
TestCaseRunner::getInstance().setTestApplication(gui_app.get());
auto result = TestCaseRunner::getInstance().run(user_args);
TestCaseRunner::getInstance().run(user_args);
#ifdef _WIN32
CoUninitialize();