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