tests: Added operator test

This commit is contained in:
WerWolv
2021-09-12 21:54:18 +02:00
parent bed5361879
commit 7fbb540674
4 changed files with 79 additions and 4 deletions

View File

@@ -86,13 +86,13 @@ int test(int argc, char **argv) {
};
// Check if the right number of patterns have been produced
if (patterns->size() != currTest->getPatterns().size()) {
if (patterns->size() != currTest->getPatterns().size() && !currTest->getPatterns().empty()) {
hex::log::fatal("Source didn't produce expected number of patterns");
return EXIT_FAILURE;
}
// Check if the produced patterns are the ones expected
for (u32 i = 0; i < patterns->size(); i++) {
for (u32 i = 0; i < currTest->getPatterns().size(); i++) {
auto &left = *patterns->at(i);
auto &right = *currTest->getPatterns().at(i);

View File

@@ -9,6 +9,7 @@
#include "test_patterns/test_pattern_succeeding_assert.hpp"
#include "test_patterns/test_pattern_failing_assert.hpp"
#include "test_patterns/test_pattern_bitfields.hpp"
#include "test_patterns/test_pattern_math.hpp"
std::array Tests = {
TEST(Placement),
@@ -19,5 +20,6 @@ std::array Tests = {
TEST(Padding),
TEST(SucceedingAssert),
TEST(FailingAssert),
TEST(Bitfields)
TEST(Bitfields),
TEST(Math)
};