blob: a7fb723a2834fb1abcc3b5dd9a34cce09469a962 [file] [log] [blame]
Lawrence Tangd34f2b12022-07-19 15:36:31 +01001#ifndef CPER_IR_TEST_UTILS_H
2#define CPER_IR_TEST_UTILS_H
3
Ed Tanousedee0a32025-03-16 17:40:04 -07004#ifdef __cplusplus
5extern "C" {
6#endif
7
Ed Tanousc97c0412025-02-04 11:31:31 -08008#include <stdio.h>
Thu Nguyene42fb482024-10-15 14:43:11 +00009#include <libcper/BaseTypes.h>
Aushim Nagarkattiae8f6d92025-01-29 17:34:44 -080010#include <libcper/generator/sections/gen-section.h>
Ed Tanousa3663052025-03-16 12:54:36 -070011#include <json.h>
Lawrence Tangd34f2b12022-07-19 15:36:31 +010012
Ed Tanousd6b62632025-03-14 15:30:07 -070013// 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 Tanousedee0a32025-03-16 17:40:04 -070016enum AddRequiredProps { AddRequired, NoModify };
Ed Tanousd6b62632025-03-14 15:30:07 -070017
John Chungf8fc7052024-05-03 20:05:29 +080018FILE *generate_record_memstream(const char **types, UINT16 num_types,
19 char **buf, size_t *buf_size,
Aushim Nagarkattiae8f6d92025-01-29 17:34:44 -080020 int single_section,
21 GEN_VALID_BITS_TEST_TYPE validBitsType);
Ed Tanousd6b62632025-03-14 15:30:07 -070022
Ed Tanousa3663052025-03-16 12:54:36 -070023int schema_validate_from_file(json_object *to_test, int single_section,
24 int all_valid_bits);
Lawrence Tangd34f2b12022-07-19 15:36:31 +010025
Ed Tanousedee0a32025-03-16 17:40:04 -070026#ifdef __cplusplus
27}
28#endif
29
John Chungf8fc7052024-05-03 20:05:29 +080030#endif