|
|
|
@ -13,6 +13,7 @@
@@ -13,6 +13,7 @@
|
|
|
|
|
|
|
|
|
|
#include "../../src/data.h" |
|
|
|
|
#include "ttest.h" |
|
|
|
|
#include "test.h" |
|
|
|
|
|
|
|
|
|
/** Macro to squash unused variable compiler warnings. */ |
|
|
|
|
#define UNUSED(_x) ((void)(_x)) |
|
|
|
@ -387,6 +388,56 @@ static bool test_load_mapping_entry_float(
@@ -387,6 +388,56 @@ static bool test_load_mapping_entry_float(
|
|
|
|
|
return ttest_pass(&tc); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Test loading a floating point value as a float. |
|
|
|
|
* |
|
|
|
|
* \param[in] report The test report context. |
|
|
|
|
* \param[in] config The CYAML config to use for the test. |
|
|
|
|
* \return true if test passes, false otherwise. |
|
|
|
|
*/ |
|
|
|
|
static bool test_load_mapping_entry_float_underflow( |
|
|
|
|
ttest_report_ctx_t *report, |
|
|
|
|
const cyaml_config_t *config) |
|
|
|
|
{ |
|
|
|
|
float value = 1.55331e-40f; |
|
|
|
|
static const unsigned char yaml[] = |
|
|
|
|
"test_fp: 1.55331e-40\n"; |
|
|
|
|
struct target_struct { |
|
|
|
|
float test_value_fp; |
|
|
|
|
} *data_tgt = NULL; |
|
|
|
|
static const struct cyaml_schema_field mapping_schema[] = { |
|
|
|
|
CYAML_FIELD_FLOAT("test_fp", CYAML_FLAG_DEFAULT, |
|
|
|
|
struct target_struct, test_value_fp), |
|
|
|
|
CYAML_FIELD_END |
|
|
|
|
}; |
|
|
|
|
static const struct cyaml_schema_value top_schema = { |
|
|
|
|
CYAML_VALUE_MAPPING(CYAML_FLAG_POINTER, |
|
|
|
|
struct target_struct, mapping_schema), |
|
|
|
|
}; |
|
|
|
|
test_data_t td = { |
|
|
|
|
.data = (cyaml_data_t **) &data_tgt, |
|
|
|
|
.config = config, |
|
|
|
|
.schema = &top_schema, |
|
|
|
|
}; |
|
|
|
|
cyaml_err_t err; |
|
|
|
|
|
|
|
|
|
ttest_ctx_t tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
|
|
|
|
|
err = cyaml_load_data(yaml, YAML_LEN(yaml), config, &top_schema, |
|
|
|
|
(cyaml_data_t **) &data_tgt, NULL); |
|
|
|
|
if (err != CYAML_OK) { |
|
|
|
|
return ttest_fail(&tc, cyaml_strerror(err)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (data_tgt->test_value_fp != value) { |
|
|
|
|
return ttest_fail(&tc, "Incorrect value: " |
|
|
|
|
"expected: %e, got: %e", |
|
|
|
|
value, data_tgt->test_value_fp); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ttest_pass(&tc); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Test loading a floating point value as a pointer to float. |
|
|
|
|
* |
|
|
|
@ -487,6 +538,57 @@ static bool test_load_mapping_entry_double(
@@ -487,6 +538,57 @@ static bool test_load_mapping_entry_double(
|
|
|
|
|
return ttest_pass(&tc); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Test loading a floating point value as a double. |
|
|
|
|
* |
|
|
|
|
* \param[in] report The test report context. |
|
|
|
|
* \param[in] config The CYAML config to use for the test. |
|
|
|
|
* \return true if test passes, false otherwise. |
|
|
|
|
*/ |
|
|
|
|
static bool test_load_mapping_entry_double_underflow( |
|
|
|
|
ttest_report_ctx_t *report, |
|
|
|
|
const cyaml_config_t *config) |
|
|
|
|
{ |
|
|
|
|
double value = 1.79769e+308; |
|
|
|
|
static const unsigned char yaml[] = |
|
|
|
|
"test_fp: 1.79769e+309\n"; |
|
|
|
|
struct target_struct { |
|
|
|
|
double test_value_fp; |
|
|
|
|
} *data_tgt = NULL; |
|
|
|
|
static const struct cyaml_schema_field mapping_schema[] = { |
|
|
|
|
CYAML_FIELD_FLOAT("test_fp", CYAML_FLAG_DEFAULT, |
|
|
|
|
struct target_struct, test_value_fp), |
|
|
|
|
CYAML_FIELD_END |
|
|
|
|
}; |
|
|
|
|
static const struct cyaml_schema_value top_schema = { |
|
|
|
|
CYAML_VALUE_MAPPING(CYAML_FLAG_POINTER, |
|
|
|
|
struct target_struct, mapping_schema), |
|
|
|
|
}; |
|
|
|
|
test_data_t td = { |
|
|
|
|
.data = (cyaml_data_t **) &data_tgt, |
|
|
|
|
.config = config, |
|
|
|
|
.schema = &top_schema, |
|
|
|
|
}; |
|
|
|
|
cyaml_err_t err; |
|
|
|
|
|
|
|
|
|
ttest_ctx_t tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
|
|
|
|
|
value *= 10; |
|
|
|
|
err = cyaml_load_data(yaml, YAML_LEN(yaml), config, &top_schema, |
|
|
|
|
(cyaml_data_t **) &data_tgt, NULL); |
|
|
|
|
if (err != CYAML_OK) { |
|
|
|
|
return ttest_fail(&tc, cyaml_strerror(err)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (data_tgt->test_value_fp != value) { |
|
|
|
|
return ttest_fail(&tc, "Incorrect value: " |
|
|
|
|
"expected: %lf, got: %lf", |
|
|
|
|
value, data_tgt->test_value_fp); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ttest_pass(&tc); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Test loading a floating point value as a pointer to double. |
|
|
|
|
* |
|
|
|
@ -907,6 +1009,66 @@ static bool test_load_mapping_entry_enum_sparse(
@@ -907,6 +1009,66 @@ static bool test_load_mapping_entry_enum_sparse(
|
|
|
|
|
return ttest_pass(&tc); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Test loading an enumeration with numerical fallback. |
|
|
|
|
* |
|
|
|
|
* \param[in] report The test report context. |
|
|
|
|
* \param[in] config The CYAML config to use for the test. |
|
|
|
|
* \return true if test passes, false otherwise. |
|
|
|
|
*/ |
|
|
|
|
static bool test_load_mapping_entry_enum_fallback( |
|
|
|
|
ttest_report_ctx_t *report, |
|
|
|
|
const cyaml_config_t *config) |
|
|
|
|
{ |
|
|
|
|
enum test_enum { |
|
|
|
|
TEST_ENUM_FIRST = 3, |
|
|
|
|
TEST_ENUM_SECOND = 77, |
|
|
|
|
TEST_ENUM_THIRD = 183, |
|
|
|
|
TEST_ENUM_FOURTH = 9900, |
|
|
|
|
} value = TEST_ENUM_SECOND; |
|
|
|
|
static const cyaml_strval_t strings[] = { |
|
|
|
|
{ "first", TEST_ENUM_FIRST }, |
|
|
|
|
{ "second", TEST_ENUM_SECOND }, |
|
|
|
|
{ "third", TEST_ENUM_THIRD }, |
|
|
|
|
{ "fourth", TEST_ENUM_FOURTH }, |
|
|
|
|
}; |
|
|
|
|
static const unsigned char yaml[] = |
|
|
|
|
"test_enum: 77\n"; |
|
|
|
|
struct target_struct { |
|
|
|
|
enum test_enum test_value_enum; |
|
|
|
|
} *data_tgt = NULL; |
|
|
|
|
static const struct cyaml_schema_field mapping_schema[] = { |
|
|
|
|
CYAML_FIELD_ENUM("test_enum", CYAML_FLAG_DEFAULT, |
|
|
|
|
struct target_struct, test_value_enum, |
|
|
|
|
strings, CYAML_ARRAY_LEN(strings)), |
|
|
|
|
CYAML_FIELD_END |
|
|
|
|
}; |
|
|
|
|
static const struct cyaml_schema_value top_schema = { |
|
|
|
|
CYAML_VALUE_MAPPING(CYAML_FLAG_POINTER, |
|
|
|
|
struct target_struct, mapping_schema), |
|
|
|
|
}; |
|
|
|
|
test_data_t td = { |
|
|
|
|
.data = (cyaml_data_t **) &data_tgt, |
|
|
|
|
.config = config, |
|
|
|
|
.schema = &top_schema, |
|
|
|
|
}; |
|
|
|
|
cyaml_err_t err; |
|
|
|
|
|
|
|
|
|
ttest_ctx_t tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
|
|
|
|
|
err = cyaml_load_data(yaml, YAML_LEN(yaml), config, &top_schema, |
|
|
|
|
(cyaml_data_t **) &data_tgt, NULL); |
|
|
|
|
if (err != CYAML_OK) { |
|
|
|
|
return ttest_fail(&tc, cyaml_strerror(err)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (data_tgt->test_value_enum != value) { |
|
|
|
|
return ttest_fail(&tc, "Incorrect value"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ttest_pass(&tc); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Test loading a string to a character array. |
|
|
|
|
* |
|
|
|
@ -1707,12 +1869,13 @@ static bool test_load_mapping_entry_mapping(
@@ -1707,12 +1869,13 @@ static bool test_load_mapping_entry_mapping(
|
|
|
|
|
.schema = &top_schema, |
|
|
|
|
}; |
|
|
|
|
cyaml_err_t err; |
|
|
|
|
ttest_ctx_t tc; |
|
|
|
|
|
|
|
|
|
memset(&value, 0, sizeof(value)); |
|
|
|
|
value.a = 123; |
|
|
|
|
value.b = 9999; |
|
|
|
|
|
|
|
|
|
ttest_ctx_t tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
|
|
|
|
|
err = cyaml_load_data(yaml, YAML_LEN(yaml), config, &top_schema, |
|
|
|
|
(cyaml_data_t **) &data_tgt, NULL); |
|
|
|
@ -1770,12 +1933,13 @@ static bool test_load_mapping_entry_mapping_ptr(
@@ -1770,12 +1933,13 @@ static bool test_load_mapping_entry_mapping_ptr(
|
|
|
|
|
.schema = &top_schema, |
|
|
|
|
}; |
|
|
|
|
cyaml_err_t err; |
|
|
|
|
ttest_ctx_t tc; |
|
|
|
|
|
|
|
|
|
memset(&value, 0, sizeof(value)); |
|
|
|
|
value.a = 123; |
|
|
|
|
value.b = 9999; |
|
|
|
|
|
|
|
|
|
ttest_ctx_t tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
|
|
|
|
|
err = cyaml_load_data(yaml, YAML_LEN(yaml), config, &top_schema, |
|
|
|
|
(cyaml_data_t **) &data_tgt, NULL); |
|
|
|
@ -2350,6 +2514,7 @@ static bool test_load_mapping_entry_sequence_mapping(
@@ -2350,6 +2514,7 @@ static bool test_load_mapping_entry_sequence_mapping(
|
|
|
|
|
.schema = &top_schema, |
|
|
|
|
}; |
|
|
|
|
cyaml_err_t err; |
|
|
|
|
ttest_ctx_t tc; |
|
|
|
|
|
|
|
|
|
memset(ref, 0, sizeof(ref)); |
|
|
|
|
ref[0].a = 123; |
|
|
|
@ -2359,7 +2524,7 @@ static bool test_load_mapping_entry_sequence_mapping(
@@ -2359,7 +2524,7 @@ static bool test_load_mapping_entry_sequence_mapping(
|
|
|
|
|
ref[2].a = 1; |
|
|
|
|
ref[2].b = 765; |
|
|
|
|
|
|
|
|
|
ttest_ctx_t tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
|
|
|
|
|
err = cyaml_load_data(yaml, YAML_LEN(yaml), config, &top_schema, |
|
|
|
|
(cyaml_data_t **) &data_tgt, NULL); |
|
|
|
@ -4865,7 +5030,7 @@ static bool test_load_mapping_with_optional_fields(
@@ -4865,7 +5030,7 @@ static bool test_load_mapping_with_optional_fields(
|
|
|
|
|
const cyaml_config_t *config) |
|
|
|
|
{ |
|
|
|
|
long values[] = { 4, 3, 2, 1 }; |
|
|
|
|
struct target_struct { |
|
|
|
|
const struct target_struct { |
|
|
|
|
char *a; |
|
|
|
|
char b[10]; |
|
|
|
|
int c; |
|
|
|
@ -4880,12 +5045,12 @@ static bool test_load_mapping_with_optional_fields(
@@ -4880,12 +5045,12 @@ static bool test_load_mapping_with_optional_fields(
|
|
|
|
|
long *k; |
|
|
|
|
unsigned k_count; |
|
|
|
|
} data = { |
|
|
|
|
.a = "Hello", |
|
|
|
|
.a = (char *) "Hello", |
|
|
|
|
.b = "World!", |
|
|
|
|
.c = 0, |
|
|
|
|
.d = { 0, 0, 0, 0 }, |
|
|
|
|
.e = values, |
|
|
|
|
.f = "Required!", |
|
|
|
|
.f = (char *) "Required!", |
|
|
|
|
.g = NULL, |
|
|
|
|
.h = "\0", |
|
|
|
|
.i = 9876, |
|
|
|
@ -5056,6 +5221,56 @@ static bool test_load_mapping_only_optional_fields(
@@ -5056,6 +5221,56 @@ static bool test_load_mapping_only_optional_fields(
|
|
|
|
|
return ttest_pass(&tc); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Test loading a mapping with only optional fields. |
|
|
|
|
* |
|
|
|
|
* \param[in] report The test report context. |
|
|
|
|
* \param[in] config The CYAML config to use for the test. |
|
|
|
|
* \return true if test passes, false otherwise. |
|
|
|
|
*/ |
|
|
|
|
static bool test_load_mapping_without_any_fields( |
|
|
|
|
ttest_report_ctx_t *report, |
|
|
|
|
const cyaml_config_t *config) |
|
|
|
|
{ |
|
|
|
|
struct target_struct { |
|
|
|
|
int i; |
|
|
|
|
}; |
|
|
|
|
static const unsigned char yaml[] = |
|
|
|
|
"{}\n"; |
|
|
|
|
struct target_struct *data_tgt = NULL; |
|
|
|
|
static const struct cyaml_schema_field mapping_schema[] = { |
|
|
|
|
CYAML_FIELD_END |
|
|
|
|
}; |
|
|
|
|
static const struct cyaml_schema_value top_schema = { |
|
|
|
|
CYAML_VALUE_MAPPING(CYAML_FLAG_POINTER, |
|
|
|
|
struct target_struct, mapping_schema), |
|
|
|
|
}; |
|
|
|
|
test_data_t td = { |
|
|
|
|
.data = (cyaml_data_t **) &data_tgt, |
|
|
|
|
.config = config, |
|
|
|
|
.schema = &top_schema, |
|
|
|
|
}; |
|
|
|
|
cyaml_err_t err; |
|
|
|
|
|
|
|
|
|
ttest_ctx_t tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
|
|
|
|
|
err = cyaml_load_data(yaml, YAML_LEN(yaml), config, &top_schema, |
|
|
|
|
(cyaml_data_t **) &data_tgt, NULL); |
|
|
|
|
if (err != CYAML_OK) { |
|
|
|
|
return ttest_fail(&tc, cyaml_strerror(err)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (data_tgt == NULL) { |
|
|
|
|
return ttest_fail(&tc, "Should have allocated empty structure"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (data_tgt->i != 0) { |
|
|
|
|
return ttest_fail(&tc, "Value should be initialied to 0"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ttest_pass(&tc); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Test loading a mapping with unknown keys ignored by config. |
|
|
|
|
* |
|
|
|
@ -5246,9 +5461,10 @@ static bool test_load_no_log(
@@ -5246,9 +5461,10 @@ static bool test_load_no_log(
|
|
|
|
|
.schema = &top_schema, |
|
|
|
|
}; |
|
|
|
|
cyaml_err_t err; |
|
|
|
|
ttest_ctx_t tc; |
|
|
|
|
|
|
|
|
|
cfg.log_fn = NULL; |
|
|
|
|
ttest_ctx_t tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
|
|
|
|
|
err = cyaml_load_data(yaml, YAML_LEN(yaml), &cfg, &top_schema, |
|
|
|
|
(cyaml_data_t **) &data_tgt, NULL); |
|
|
|
@ -5430,9 +5646,10 @@ static bool test_load_enum_insensitive(
@@ -5430,9 +5646,10 @@ static bool test_load_enum_insensitive(
|
|
|
|
|
.schema = &top_schema, |
|
|
|
|
}; |
|
|
|
|
cyaml_err_t err; |
|
|
|
|
ttest_ctx_t tc; |
|
|
|
|
|
|
|
|
|
cfg.flags |= CYAML_CFG_CASE_INSENSITIVE; |
|
|
|
|
ttest_ctx_t tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
|
|
|
|
|
err = cyaml_load_data(yaml, YAML_LEN(yaml), &cfg, &top_schema, |
|
|
|
|
(cyaml_data_t **) &data_tgt, NULL); |
|
|
|
@ -5483,9 +5700,10 @@ static bool test_load_flags_insensitive(
@@ -5483,9 +5700,10 @@ static bool test_load_flags_insensitive(
|
|
|
|
|
.schema = &top_schema, |
|
|
|
|
}; |
|
|
|
|
cyaml_err_t err; |
|
|
|
|
ttest_ctx_t tc; |
|
|
|
|
|
|
|
|
|
cfg.flags |= CYAML_CFG_CASE_INSENSITIVE; |
|
|
|
|
ttest_ctx_t tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
|
|
|
|
|
err = cyaml_load_data(yaml, YAML_LEN(yaml), &cfg, &top_schema, |
|
|
|
|
(cyaml_data_t **) &data_tgt, NULL); |
|
|
|
@ -5555,9 +5773,10 @@ static bool test_load_mapping_fields_cfg_insensitive_1(
@@ -5555,9 +5773,10 @@ static bool test_load_mapping_fields_cfg_insensitive_1(
|
|
|
|
|
.schema = &top_schema, |
|
|
|
|
}; |
|
|
|
|
cyaml_err_t err; |
|
|
|
|
ttest_ctx_t tc; |
|
|
|
|
|
|
|
|
|
cfg.flags |= CYAML_CFG_CASE_INSENSITIVE; |
|
|
|
|
ttest_ctx_t tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
|
|
|
|
|
err = cyaml_load_data(yaml, YAML_LEN(yaml), &cfg, &top_schema, |
|
|
|
|
(cyaml_data_t **) &data_tgt, NULL); |
|
|
|
@ -5639,9 +5858,10 @@ static bool test_load_mapping_fields_cfg_insensitive_2(
@@ -5639,9 +5858,10 @@ static bool test_load_mapping_fields_cfg_insensitive_2(
|
|
|
|
|
.schema = &top_schema, |
|
|
|
|
}; |
|
|
|
|
cyaml_err_t err; |
|
|
|
|
ttest_ctx_t tc; |
|
|
|
|
|
|
|
|
|
cfg.flags |= CYAML_CFG_CASE_INSENSITIVE; |
|
|
|
|
ttest_ctx_t tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
|
|
|
|
|
err = cyaml_load_data(yaml, YAML_LEN(yaml), &cfg, &top_schema, |
|
|
|
|
(cyaml_data_t **) &data_tgt, NULL); |
|
|
|
@ -5723,9 +5943,10 @@ static bool test_load_mapping_fields_cfg_insensitive_3(
@@ -5723,9 +5943,10 @@ static bool test_load_mapping_fields_cfg_insensitive_3(
|
|
|
|
|
.schema = &top_schema, |
|
|
|
|
}; |
|
|
|
|
cyaml_err_t err; |
|
|
|
|
ttest_ctx_t tc; |
|
|
|
|
|
|
|
|
|
cfg.flags |= CYAML_CFG_CASE_INSENSITIVE; |
|
|
|
|
ttest_ctx_t tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
|
|
|
|
|
err = cyaml_load_data(yaml, YAML_LEN(yaml), &cfg, &top_schema, |
|
|
|
|
(cyaml_data_t **) &data_tgt, NULL); |
|
|
|
@ -5808,9 +6029,10 @@ static bool test_load_mapping_fields_value_sensitive_1(
@@ -5808,9 +6029,10 @@ static bool test_load_mapping_fields_value_sensitive_1(
|
|
|
|
|
.schema = &top_schema, |
|
|
|
|
}; |
|
|
|
|
cyaml_err_t err; |
|
|
|
|
ttest_ctx_t tc; |
|
|
|
|
|
|
|
|
|
cfg.flags |= CYAML_CFG_CASE_INSENSITIVE; |
|
|
|
|
ttest_ctx_t tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
|
|
|
|
|
err = cyaml_load_data(yaml, YAML_LEN(yaml), &cfg, &top_schema, |
|
|
|
|
(cyaml_data_t **) &data_tgt, NULL); |
|
|
|
@ -5894,9 +6116,10 @@ static bool test_load_mapping_fields_value_insensitive_1(
@@ -5894,9 +6116,10 @@ static bool test_load_mapping_fields_value_insensitive_1(
|
|
|
|
|
.schema = &top_schema, |
|
|
|
|
}; |
|
|
|
|
cyaml_err_t err; |
|
|
|
|
ttest_ctx_t tc; |
|
|
|
|
|
|
|
|
|
cfg.flags |= CYAML_CFG_CASE_INSENSITIVE; |
|
|
|
|
ttest_ctx_t tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
tc = ttest_start(report, __func__, cyaml_cleanup, &td); |
|
|
|
|
|
|
|
|
|
err = cyaml_load_data(yaml, YAML_LEN(yaml), &cfg, &top_schema, |
|
|
|
|
(cyaml_data_t **) &data_tgt, NULL); |
|
|
|
@ -6569,8 +6792,11 @@ bool load_tests(
@@ -6569,8 +6792,11 @@ bool load_tests(
|
|
|
|
|
pass &= test_load_mapping_entry_enum_sparse(rc, &config); |
|
|
|
|
pass &= test_load_mapping_entry_ignore_deep(rc, &config); |
|
|
|
|
pass &= test_load_mapping_entry_ignore_scalar(rc, &config); |
|
|
|
|
pass &= test_load_mapping_entry_enum_fallback(rc, &config); |
|
|
|
|
pass &= test_load_mapping_entry_bool_true_ptr(rc, &config); |
|
|
|
|
pass &= test_load_mapping_entry_bool_false_ptr(rc, &config); |
|
|
|
|
pass &= test_load_mapping_entry_float_underflow(rc, &config); |
|
|
|
|
pass &= test_load_mapping_entry_double_underflow(rc, &config); |
|
|
|
|
pass &= test_load_mapping_entry_string_ptr_empty(rc, &config); |
|
|
|
|
pass &= test_load_mapping_entry_string_ptr_null_str(rc, &config); |
|
|
|
|
pass &= test_load_mapping_entry_string_ptr_null_empty(rc, &config); |
|
|
|
@ -6642,6 +6868,7 @@ bool load_tests(
@@ -6642,6 +6868,7 @@ bool load_tests(
|
|
|
|
|
pass &= test_load_schema_top_level_string(rc, &config); |
|
|
|
|
pass &= test_load_schema_top_level_sequence(rc, &config); |
|
|
|
|
pass &= test_load_multiple_documents_ignored(rc, &config); |
|
|
|
|
pass &= test_load_mapping_without_any_fields(rc, &config); |
|
|
|
|
pass &= test_load_mapping_with_multiple_fields(rc, &config); |
|
|
|
|
pass &= test_load_mapping_with_optional_fields(rc, &config); |
|
|
|
|
pass &= test_load_mapping_only_optional_fields(rc, &config); |
|
|
|
|