Shift section definitions into separate file, add testing.
Change-Id: Idb0b41d7fa2999485580fca770958a27c1086f65
diff --git a/tests/ir-tests.cpp b/tests/ir-tests.cpp
index a961e40..1017e75 100644
--- a/tests/ir-tests.cpp
+++ b/tests/ir-tests.cpp
@@ -11,6 +11,7 @@
#include "../cper-parse.h"
#include "../json-schema.h"
#include "../generator/cper-generate.h"
+#include "../sections/cper-section.h"
}
/*
@@ -98,6 +99,22 @@
}
/*
+* Non-single section assertions.
+*/
+TEST(CompileTimeAssertions, TwoWayConversion)
+{
+ for (int i=0; i<section_definitions_len; i++)
+ {
+ //If a conversion one way exists, a conversion the other way must exist.
+ std::string err = "If a CPER conversion exists one way, there must be an equivalent method in reverse.";
+ if (section_definitions[i].ToCPER != NULL)
+ ASSERT_NE(section_definitions[i].ToIR, NULL) << err;
+ if (section_definitions[i].ToIR != NULL)
+ ASSERT_NE(section_definitions[i].ToCPER, NULL) << err;
+ }
+}
+
+/*
* Single section tests.
*/