--- libnih-1.0.3/nih-dbus-tool/tests/test_parse.c.old 2010-09-20 18:17:01.000000000 -0500
+++ libnih-1.0.3/nih-dbus-tool/tests/test_parse.c 2017-09-27 20:40:32.998734677 -0500
@@ -1583,11 +1583,16 @@
Signal * signal;
Property * property;
Argument * argument;
+ char mem_error[280] = "test:foo:[0-9]*:[0-9]*: ";
TEST_FUNCTION ("parse_xml");
fp = tmpfile ();
output = tmpfile ();
+
+ strerror_r(ENOMEM, mem_error+24, 254);
+ mem_error[strlen(mem_error)] = '\n';
+
/* Check that a file containing a single node entity is parsed
* successfully, returning a Node structure with no information
* attached.
@@ -1608,8 +1613,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -1645,8 +1649,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -1686,8 +1689,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -1743,8 +1745,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -1800,8 +1801,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -1857,8 +1857,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -1916,8 +1915,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -1973,8 +1971,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -2047,8 +2044,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -2121,8 +2117,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -2195,8 +2190,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -2271,8 +2265,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -2345,8 +2338,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -2419,8 +2411,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -2493,8 +2484,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -2567,8 +2557,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -2641,8 +2630,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -2729,8 +2717,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -2817,8 +2804,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -2904,8 +2890,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -2992,8 +2977,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -3107,8 +3091,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -3199,8 +3182,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -3291,8 +3273,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -3417,8 +3398,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -3575,8 +3555,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -3647,8 +3626,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -3719,8 +3697,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -3791,8 +3768,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -3865,8 +3841,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -3937,8 +3912,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -4023,8 +3997,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -4108,8 +4081,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -4194,8 +4166,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -4306,8 +4277,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -4426,8 +4396,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -4579,8 +4548,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -4652,8 +4620,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -4725,8 +4692,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -4800,8 +4766,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -4875,8 +4840,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -4950,8 +4914,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -5027,8 +4990,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -5104,8 +5066,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -5233,8 +5194,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -5570,8 +5530,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;
@@ -5996,8 +5955,7 @@
if (test_alloc_failed) {
TEST_EQ_P (node, NULL);
- TEST_FILE_MATCH (output, ("test:foo:[0-9]*:[0-9]*: "
- "Cannot allocate memory\n"));
+ TEST_FILE_MATCH (output, mem_error);
TEST_FILE_END (output);
TEST_FILE_RESET (output);
continue;