1 Fix build against libyaml 0.2.5.
4 https://github.com/tlsa/libcyaml/commit/0e947264b947f51f7ea785068637c4bfce5d4171
6 diff --git a/test/units/save.c b/test/units/save.c
7 --- a/test/units/save.c
8 +++ b/test/units/save.c
9 @@ -3476,7 +3476,7 @@ static bool test_save_sequence_null_values_int(
10 ttest_report_ctx_t *report,
11 const cyaml_config_t *config)
13 - static const unsigned char ref[] =
14 + static const unsigned char ref1[] =
18 @@ -3487,6 +3487,18 @@ static bool test_save_sequence_null_values_int(
22 + /* As of libyaml 0.2.5, trailing spaces are not emitted. */
23 + static const unsigned char ref2[] =
34 static const int d[] = { 7, 6, 5, 4, 3, 2, 1, 0 };
35 static const int *data[] = { d + 0, d + 1, d + 2, NULL,
36 d + 4, d + 5, NULL, d + 7, };
37 @@ -3515,11 +3527,12 @@ static bool test_save_sequence_null_values_int(
38 return ttest_fail(&tc, cyaml_strerror(err));
41 - if (len != YAML_LEN(ref) || memcmp(ref, buffer, len) != 0) {
42 + if ((len != YAML_LEN(ref1) || memcmp(ref1, buffer, len) != 0) &&
43 + (len != YAML_LEN(ref2) || memcmp(ref2, buffer, len) != 0)) {
44 return ttest_fail(&tc, "Bad data:\n"
45 "EXPECTED (%zu):\n\n%.*s\n\n"
46 "GOT (%zu):\n\n%.*s\n",
47 - YAML_LEN(ref), YAML_LEN(ref), ref,
48 + YAML_LEN(ref1), YAML_LEN(ref1), ref1,