Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 1 | /** |
| 2 | * Defines tests for validating CPER-JSON IR output from the cper-parse library. |
| 3 | * |
| 4 | * Author: Lawrence.Tang@arm.com |
| 5 | **/ |
| 6 | |
| 7 | #include "gtest/gtest.h" |
| 8 | #include "test-utils.hpp" |
| 9 | extern "C" { |
Lawrence Tang | 5202bbb | 2022-08-12 14:54:36 +0100 | [diff] [blame] | 10 | #include <json.h> |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 11 | #include "../cper-parse.h" |
| 12 | #include "../json-schema.h" |
| 13 | #include "../generator/cper-generate.h" |
Lawrence Tang | 580423f | 2022-08-24 09:37:53 +0100 | [diff] [blame] | 14 | #include "../sections/cper-section.h" |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | /* |
| 18 | * Test templates. |
| 19 | */ |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 20 | |
| 21 | //Tests a single randomly generated CPER section of the given type to ensure CPER-JSON IR validity. |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 22 | void cper_log_section_ir_test(const char *section_name, int single_section) |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 23 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 24 | //Generate full CPER record for the given type. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 25 | char *buf; |
| 26 | size_t size; |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 27 | FILE *record = generate_record_memstream(§ion_name, 1, &buf, &size, |
| 28 | single_section); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 29 | |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 30 | //Convert to IR, free resources. |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 31 | json_object *ir; |
| 32 | if (single_section) |
| 33 | ir = cper_single_section_to_ir(record); |
| 34 | else |
| 35 | ir = cper_to_ir(record); |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 36 | fclose(record); |
| 37 | free(buf); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 38 | |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 39 | //Validate against schema. |
| 40 | char error_message[JSON_ERROR_MSG_MAX_LEN] = { 0 }; |
| 41 | int valid = validate_schema_from_file("./specification/cper-json.json", |
| 42 | ir, error_message); |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 43 | ASSERT_TRUE(valid) |
| 44 | << "IR validation test failed (single section mode = " |
| 45 | << single_section << ") with message: " << error_message; |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 46 | } |
| 47 | |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 48 | //Checks for binary round-trip equality for a given randomly generated CPER record. |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 49 | void cper_log_section_binary_test(const char *section_name, int single_section) |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 50 | { |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 51 | //Generate CPER record for the given type. |
| 52 | char *buf; |
| 53 | size_t size; |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 54 | FILE *record = generate_record_memstream(§ion_name, 1, &buf, &size, |
| 55 | single_section); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 56 | |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 57 | //Convert to IR. |
| 58 | json_object *ir; |
| 59 | if (single_section) |
| 60 | ir = cper_single_section_to_ir(record); |
| 61 | else |
| 62 | ir = cper_to_ir(record); |
| 63 | |
| 64 | //Now convert back to binary, and get a stream out. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 65 | char *cper_buf; |
| 66 | size_t cper_buf_size; |
| 67 | FILE *stream = open_memstream(&cper_buf, &cper_buf_size); |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 68 | if (single_section) |
| 69 | ir_single_section_to_cper(ir, stream); |
| 70 | else |
| 71 | ir_to_cper(ir, stream); |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 72 | size_t cper_len = ftell(stream); |
| 73 | fclose(stream); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 74 | |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 75 | //Validate the two are identical. |
| 76 | ASSERT_GE(size, cper_len); |
| 77 | ASSERT_EQ(memcmp(buf, cper_buf, cper_len), 0) |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 78 | << "Binary output was not identical to input (single section mode = " |
| 79 | << single_section << ")."; |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 80 | |
| 81 | //Free everything up. |
| 82 | fclose(record); |
| 83 | free(buf); |
| 84 | free(cper_buf); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 85 | } |
| 86 | |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 87 | //Tests randomly generated CPER sections for IR validity of a given type, in both single section mode and full CPER log mode. |
| 88 | void cper_log_section_dual_ir_test(const char *section_name) |
| 89 | { |
| 90 | cper_log_section_ir_test(section_name, 0); |
| 91 | cper_log_section_ir_test(section_name, 1); |
| 92 | } |
| 93 | |
| 94 | //Tests randomly generated CPER sections for binary compatibility of a given type, in both single section mode and full CPER log mode. |
| 95 | void cper_log_section_dual_binary_test(const char *section_name) |
| 96 | { |
| 97 | cper_log_section_binary_test(section_name, 0); |
| 98 | cper_log_section_binary_test(section_name, 1); |
| 99 | } |
| 100 | |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 101 | /* |
Lawrence Tang | 580423f | 2022-08-24 09:37:53 +0100 | [diff] [blame] | 102 | * Non-single section assertions. |
| 103 | */ |
| 104 | TEST(CompileTimeAssertions, TwoWayConversion) |
| 105 | { |
| 106 | for (int i=0; i<section_definitions_len; i++) |
| 107 | { |
| 108 | //If a conversion one way exists, a conversion the other way must exist. |
| 109 | std::string err = "If a CPER conversion exists one way, there must be an equivalent method in reverse."; |
| 110 | if (section_definitions[i].ToCPER != NULL) |
| 111 | ASSERT_NE(section_definitions[i].ToIR, NULL) << err; |
| 112 | if (section_definitions[i].ToIR != NULL) |
| 113 | ASSERT_NE(section_definitions[i].ToCPER, NULL) << err; |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | /* |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 118 | * Single section tests. |
| 119 | */ |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 120 | |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 121 | //Generic processor tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 122 | TEST(GenericProcessorTests, IRValid) |
| 123 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 124 | cper_log_section_dual_ir_test("generic"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 125 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 126 | TEST(GenericProcessorTests, BinaryEqual) |
| 127 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 128 | cper_log_section_dual_binary_test("generic"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | //IA32/x64 tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 132 | TEST(IA32x64Tests, IRValid) |
| 133 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 134 | cper_log_section_dual_ir_test("ia32x64"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 135 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 136 | TEST(IA32x64Tests, BinaryEqual) |
| 137 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 138 | cper_log_section_dual_binary_test("ia32x64"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 139 | } |
| 140 | |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 141 | // TEST(IPFTests, IRValid) { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 142 | // cper_log_section_dual_ir_test("ipf"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 143 | // } |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 144 | |
| 145 | //ARM tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 146 | TEST(ArmTests, IRValid) |
| 147 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 148 | cper_log_section_dual_ir_test("arm"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 149 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 150 | TEST(ArmTests, BinaryEqual) |
| 151 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 152 | cper_log_section_dual_binary_test("arm"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 153 | } |
| 154 | |
| 155 | //Memory tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 156 | TEST(MemoryTests, IRValid) |
| 157 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 158 | cper_log_section_dual_ir_test("memory"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 159 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 160 | TEST(MemoryTests, BinaryEqual) |
| 161 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 162 | cper_log_section_dual_binary_test("memory"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 163 | } |
| 164 | |
| 165 | //Memory 2 tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 166 | TEST(Memory2Tests, IRValid) |
| 167 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 168 | cper_log_section_dual_ir_test("memory2"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 169 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 170 | TEST(Memory2Tests, BinaryEqual) |
| 171 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 172 | cper_log_section_dual_binary_test("memory2"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | //PCIe tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 176 | TEST(PCIeTests, IRValid) |
| 177 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 178 | cper_log_section_dual_ir_test("pcie"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 179 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 180 | TEST(PCIeTests, BinaryEqual) |
| 181 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 182 | cper_log_section_dual_binary_test("pcie"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | //Firmware tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 186 | TEST(FirmwareTests, IRValid) |
| 187 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 188 | cper_log_section_dual_ir_test("firmware"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 189 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 190 | TEST(FirmwareTests, BinaryEqual) |
| 191 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 192 | cper_log_section_dual_binary_test("firmware"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 193 | } |
| 194 | |
| 195 | //PCI Bus tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 196 | TEST(PCIBusTests, IRValid) |
| 197 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 198 | cper_log_section_dual_ir_test("pcibus"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 199 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 200 | TEST(PCIBusTests, BinaryEqual) |
| 201 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 202 | cper_log_section_dual_binary_test("pcibus"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 203 | } |
| 204 | |
| 205 | //PCI Device tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 206 | TEST(PCIDevTests, IRValid) |
| 207 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 208 | cper_log_section_dual_ir_test("pcidev"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 209 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 210 | TEST(PCIDevTests, BinaryEqual) |
| 211 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 212 | cper_log_section_dual_binary_test("pcidev"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 213 | } |
| 214 | |
| 215 | //Generic DMAr tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 216 | TEST(DMArGenericTests, IRValid) |
| 217 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 218 | cper_log_section_dual_ir_test("dmargeneric"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 219 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 220 | TEST(DMArGenericTests, BinaryEqual) |
| 221 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 222 | cper_log_section_dual_binary_test("dmargeneric"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 223 | } |
| 224 | |
| 225 | //VT-d DMAr tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 226 | TEST(DMArVtdTests, IRValid) |
| 227 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 228 | cper_log_section_dual_ir_test("dmarvtd"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 229 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 230 | TEST(DMArVtdTests, BinaryEqual) |
| 231 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 232 | cper_log_section_dual_binary_test("dmarvtd"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 233 | } |
| 234 | |
| 235 | //IOMMU DMAr tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 236 | TEST(DMArIOMMUTests, IRValid) |
| 237 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 238 | cper_log_section_dual_ir_test("dmariommu"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 239 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 240 | TEST(DMArIOMMUTests, BinaryEqual) |
| 241 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 242 | cper_log_section_dual_binary_test("dmariommu"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 243 | } |
| 244 | |
| 245 | //CCIX PER tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 246 | TEST(CCIXPERTests, IRValid) |
| 247 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 248 | cper_log_section_dual_ir_test("ccixper"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 249 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 250 | TEST(CCIXPERTests, BinaryEqual) |
| 251 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 252 | cper_log_section_dual_binary_test("ccixper"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 253 | } |
| 254 | |
| 255 | //CXL Protocol tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 256 | TEST(CXLProtocolTests, IRValid) |
| 257 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 258 | cper_log_section_dual_ir_test("cxlprotocol"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 259 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 260 | TEST(CXLProtocolTests, BinaryEqual) |
| 261 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 262 | cper_log_section_dual_binary_test("cxlprotocol"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 263 | } |
| 264 | |
| 265 | //CXL Component tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 266 | TEST(CXLComponentTests, IRValid) |
| 267 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 268 | cper_log_section_dual_ir_test("cxlcomponent"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 269 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 270 | TEST(CXLComponentTests, BinaryEqual) |
| 271 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 272 | cper_log_section_dual_binary_test("cxlcomponent"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | //Unknown section tests. |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 276 | TEST(UnknownSectionTests, IRValid) |
| 277 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 278 | cper_log_section_dual_ir_test("unknown"); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 279 | } |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 280 | TEST(UnknownSectionTests, BinaryEqual) |
| 281 | { |
Lawrence Tang | a4f662f | 2022-08-08 14:37:36 +0100 | [diff] [blame] | 282 | cper_log_section_dual_binary_test("unknown"); |
Lawrence Tang | cd50520 | 2022-07-19 16:55:11 +0100 | [diff] [blame] | 283 | } |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 284 | |
| 285 | //Entrypoint for the testing program. |
| 286 | int main() |
| 287 | { |
Lawrence Tang | e407b4c | 2022-07-21 13:54:01 +0100 | [diff] [blame] | 288 | testing::InitGoogleTest(); |
| 289 | return RUN_ALL_TESTS(); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 290 | } |