Fix build against libyaml 0.2.5.
Taken from upstream:
https://github.com/tlsa/libcyaml/commit/0e947264b947f51f7ea785068637c4bfce5d4171
diff --git a/test/units/save.c b/test/units/save.c
--- a/test/units/save.c
+++ b/test/units/save.c
@@ -3476,7 +3476,7 @@ static bool test_save_sequence_null_values_int(
ttest_report_ctx_t *report,
const cyaml_config_t *config)
{
- static const unsigned char ref[] =
+ static const unsigned char ref1[] =
"---\n"
"- 7\n"
"- 6\n"
@@ -3487,6 +3487,18 @@ static bool test_save_sequence_null_values_int(
"- \n"
"- 0\n"
"...\n";
+ /* As of libyaml 0.2.5, trailing spaces are not emitted. */
+ static const unsigned char ref2[] =
+ "---\n"
+ "- 7\n"
+ "- 6\n"
+ "- 5\n"
+ "-\n"
+ "- 3\n"
+ "- 2\n"
+ "-\n"
+ "- 0\n"
+ "...\n";
static const int d[] = { 7, 6, 5, 4, 3, 2, 1, 0 };
static const int *data[] = { d + 0, d + 1, d + 2, NULL,
d + 4, d + 5, NULL, d + 7, };
@@ -3515,11 +3527,12 @@ static bool test_save_sequence_null_values_int(
return ttest_fail(&tc, cyaml_strerror(err));
}
- if (len != YAML_LEN(ref) || memcmp(ref, buffer, len) != 0) {
+ if ((len != YAML_LEN(ref1) || memcmp(ref1, buffer, len) != 0) &&
+ (len != YAML_LEN(ref2) || memcmp(ref2, buffer, len) != 0)) {
return ttest_fail(&tc, "Bad data:\n"
"EXPECTED (%zu):\n\n%.*s\n\n"
"GOT (%zu):\n\n%.*s\n",
- YAML_LEN(ref), YAML_LEN(ref), ref,
+ YAML_LEN(ref1), YAML_LEN(ref1), ref1,
len, len, buffer);
}
'>
Age | Commit message (Expand) | Author |
2024-11-12 | tests: Fix gremlin.scm for GCC 14...* tests/gremlin.scm: Include stdio.h before using puts since GCC 14 no
longer allows implicit declarations.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| Ting-Wei Lan |
2022-01-16 | tests: Fix file-needed/recursive on aarch64-linux....Fixes: <https://issues.guix.gnu.org/52943>.
* tests/gremlin.scm (file-needed/recursive)[ground-truth]: On aarch64-linux,
remove the dynamic linker from this list.
| Pierre Langlois |
2022-01-14 | gremlin: Adjust tests for i686 and beyond....Fixes <https://issues.guix.gnu.org/52752>.
Reported by Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>.
* tests/gremlin.scm ("file-needed/recursive"): Augment the list of vDSO
names.
| Ludovic Courtès |
2022-01-08 | tests: Fix file-needed/recursive on powerpc64le-linux....Fixes: <https://issues.guix.gnu.org/52940>.
* tests/gremlin.scm (file-needed/recursive): Consider two entries to be
equivalent not when they are the same string, but rather when they refer to
the same file.
[ground-truth]: In addition to strings that begin with "linux-vdso.so", remove
strings that begin with "linux-vdso64.so".
| Chris Marusich |
2021-06-23 | tests: gremlin: Skip file-needed/recursive if DT_NEEDED is empty....* tests/gremlin.scm (file-needed/recursive): Skip the test when (file-runpath
%guile-executable) evaluates to the empty list. This causes the test to be
correctly skipped in the case where Guix has been built using a foreign
distro's toolchain and libraries.
| Chris Marusich |
2021-04-22 | gremlin: 'elf-dynamic-info' returns a file name rathern than a dynamic entry....* guix/build/gremlin.scm (elf-dynamic-info): Return the dynamic entry
value, not the dynamic entry.
* tests/gremlin.scm ("elf-dynamic-info-soname"): New test.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| Dion Mendel |
2020-12-01 | gremlin: Add 'file-needed/recursive'....* guix/build/gremlin.scm (file-needed/recursive): New procedure.
* tests/gremlin.scm ("file-needed/recursive"): New test.
| Ludovic Courtès |
2020-09-19 | gremlin: Add 'set-file-runpath', 'file-runpath', and 'file-needed'....* guix/build/gremlin.scm (file-dynamic-info, file-runpath, file-needed):
New procedures.
(&missing-runpath-error, &runpath-too-long-error): New condition types.
(set-file-runpath): New procedure.
* tests/gremlin.scm ("set-file-runpath + file-runpath"): New test.
| Ludovic Courtès |