summaryrefslogtreecommitdiff
path: root/test/internals
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2018-12-05 13:40:46 +0000
committerRalf Habacker <ralf.habacker@freenet.de>2018-12-05 15:27:43 +0100
commit815fc621786ad01a1d9e7bda28fde32435c263f0 (patch)
tree682b63668468e3bb9c396fa9b11d6e27072816be /test/internals
parentdef9d2d051ab75021f2af653ec929736cbd718d4 (diff)
downloaddbus-815fc621786ad01a1d9e7bda28fde32435c263f0.tar.gz
syslog test: Don't assert that we see plain LF newlines
In at least some build configurations that target Windows, we see CRLF newlines in the stderr of the subprocess. Leave the newlines unspecified and let "*" match them. Signed-off-by: Simon McVittie <smcv@collabora.com> Resolves: https://gitlab.freedesktop.org/dbus/dbus/issues/243
Diffstat (limited to 'test/internals')
-rw-r--r--test/internals/syslog.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/internals/syslog.c b/test/internals/syslog.c
index 01236e96..93f885a4 100644
--- a/test/internals/syslog.c
+++ b/test/internals/syslog.c
@@ -78,15 +78,19 @@ test_syslog_normal (Fixture *f,
g_test_trap_subprocess (NULL, 0, 0);
g_test_trap_assert_passed ();
- g_test_trap_assert_stderr ("*" MESSAGE "42\n"
- "*" MESSAGE "45\n"
- "*" MESSAGE "666\n"
- "*" MESSAGE "23\n"
+ /* Deliberately not matching newlines: in Windows they might come out as
+ * either \n or \r\n, perhaps depending on GLib version or on whether
+ * we're using Wine or real Windows. */
+ g_test_trap_assert_stderr ("*" MESSAGE "42"
+ "*" MESSAGE "45"
+ "*" MESSAGE "666"
+ "*" MESSAGE "23"
"*test-syslog-stderr*" MESSAGE
- "this should not appear in the syslog\n"
+ "this should not appear in the syslog"
"*test-syslog-both*" MESSAGE
"this should appear in the syslog and "
- "on stderr\n");
+ "on stderr"
+ "*");
g_test_trap_assert_stderr_unmatched ("*this should appear in the syslog "
"only*");
g_test_trap_assert_stderr_unmatched ("*test-syslog-only*");