Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 1 | #ifndef CPER_IR_TEST_UTILS_H |
| 2 | #define CPER_IR_TEST_UTILS_H |
| 3 | |
Ed Tanous | edee0a3 | 2025-03-16 17:40:04 -0700 | [diff] [blame^] | 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
Ed Tanous | c97c041 | 2025-02-04 11:31:31 -0800 | [diff] [blame] | 8 | #include <stdio.h> |
Thu Nguyen | e42fb48 | 2024-10-15 14:43:11 +0000 | [diff] [blame] | 9 | #include <libcper/BaseTypes.h> |
Aushim Nagarkatti | ae8f6d9 | 2025-01-29 17:34:44 -0800 | [diff] [blame] | 10 | #include <libcper/generator/sections/gen-section.h> |
Ed Tanous | a366305 | 2025-03-16 12:54:36 -0700 | [diff] [blame] | 11 | #include <json.h> |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 12 | |
Ed Tanous | d6b6263 | 2025-03-14 15:30:07 -0700 | [diff] [blame] | 13 | // Controls whether required properties are added to the majority of property |
| 14 | // definitions. This is useful for unit tests that are validating JSON where |
| 15 | // all fields are valid |
Ed Tanous | edee0a3 | 2025-03-16 17:40:04 -0700 | [diff] [blame^] | 16 | enum AddRequiredProps { AddRequired, NoModify }; |
Ed Tanous | d6b6263 | 2025-03-14 15:30:07 -0700 | [diff] [blame] | 17 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 18 | FILE *generate_record_memstream(const char **types, UINT16 num_types, |
| 19 | char **buf, size_t *buf_size, |
Aushim Nagarkatti | ae8f6d9 | 2025-01-29 17:34:44 -0800 | [diff] [blame] | 20 | int single_section, |
| 21 | GEN_VALID_BITS_TEST_TYPE validBitsType); |
Ed Tanous | d6b6263 | 2025-03-14 15:30:07 -0700 | [diff] [blame] | 22 | |
Ed Tanous | a366305 | 2025-03-16 12:54:36 -0700 | [diff] [blame] | 23 | int schema_validate_from_file(json_object *to_test, int single_section, |
| 24 | int all_valid_bits); |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 25 | |
Ed Tanous | edee0a3 | 2025-03-16 17:40:04 -0700 | [diff] [blame^] | 26 | #ifdef __cplusplus |
| 27 | } |
| 28 | #endif |
| 29 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 30 | #endif |