Lines Matching +full:full +full:- +full:length

2  * Defines tests for validating CPER-JSON IR output from the cper-parse library.
7 #include "test-utils.h"
12 #include <libcper/cper-parse.h>
13 #include <libcper/generator/cper-generate.h>
14 #include <libcper/generator/sections/gen-section.h>
15 #include <libcper/json-schema.h>
16 #include <libcper/sections/cper-section.h>
40 free(info->cper_out); in free_file_info()
41 free(info->json_out); in free_file_info()
59 info->cper_out = (char *)malloc(size); in file_info_init()
60 ret = snprintf(info->cper_out, size, "%s/%s.%s", LIBCPER_EXAMPLES, in file_info_init()
62 if (ret != (int)size - 1) { in file_info_init()
68 info->json_out = (char *)malloc(size); in file_info_init()
69 ret = snprintf(info->json_out, size, "%s/%s.%s", LIBCPER_EXAMPLES, in file_info_init()
71 if (ret != (int)size - 1) { in file_info_init()
86 //Generate full CPER record for the given type. in cper_create_examples()
103 outFile = fopen(info->cper_out, "wb"); in cper_create_examples()
106 info->cper_out); in cper_create_examples()
148 json_object_to_file_ext(info->json_out, ir, JSON_C_TO_STRING_PRETTY); in cper_create_examples()
165 return ch - '0'; in hex2int()
168 return ch - 'A' + 10; in hex2int()
171 return ch - 'a' + 10; in hex2int()
173 return -1; in hex2int()
176 int string_to_binary(const char *source, size_t length, unsigned char **retval) in string_to_binary() argument
178 size_t retval_size = length * 2; in string_to_binary()
184 for (size_t i = 0; i < length; i++) { in string_to_binary()
192 return -1; in string_to_binary()
215 FILE *cper_file = fopen(info->cper_out, "rb"); in cper_example_section_ir_test()
217 printf("Failed to open CPER file: %s\n", info->cper_out); in cper_example_section_ir_test()
223 size_t length = ftell(cper_file); in cper_example_section_ir_test() local
225 char *buffer = (char *)malloc(length); in cper_example_section_ir_test()
230 if (fread(buffer, 1, length, cper_file) != length) { in cper_example_section_ir_test()
231 printf("Failed to read CPER file: %s\n", info->cper_out); in cper_example_section_ir_test()
239 int cper_bin_len = string_to_binary(buffer, length, &cper_bin); in cper_example_section_ir_test()
260 json_object *expected = json_object_from_file(info->json_out); in cper_example_section_ir_test()
281 //Tests a single randomly generated CPER section of the given type to ensure CPER-JSON IR validity.
285 //Generate full CPER record for the given type. in cper_log_section_ir_test()
314 //Tests a single randomly generated CPER section of the given type to ensure CPER-JSON IR validity.
318 //Generate full CPER record for the given type. in cper_buf_log_section_ir_test()
356 return -1; in to_hex()
365 return -1; in to_hex()
375 //Checks for binary round-trip equality for a given randomly generated CPER record.
431 … CPER sections for IR validity of a given type, in both single section mode and full CPER log mode.
446 …tions for binary compatibility of a given type, in both single section mode and full CPER log mode.
454 * Non-single section assertions.
588 //VT-d DMAr tests.
631 cper_log_section_dual_ir_test("cxlcomponent-media"); in CXLComponentTests_IRValid()
635 cper_log_section_dual_binary_test("cxlcomponent-media"); in CXLComponentTests_BinaryEqual()
656 cper_example_section_ir_test("memory-validation-bits"); in MemoryValidationBitsSectionTests_IRValid()
687 cper_create_examples("cxlcomponent-media"); in main()