From 6d8356d2084e0cc41ccc70db80e364bce10f0280 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 23 Dec 2018 00:54:39 +0100 Subject: [PATCH] tests: fix unit test Use more universal /usr/bin/env bash (as older systems do only have /bin/sh) Uncommment disabled event_activation testing. --- test/unit/activation-generator_t.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/unit/activation-generator_t.c b/test/unit/activation-generator_t.c index 6aa115c1c..8157c0c1e 100644 --- a/test/unit/activation-generator_t.c +++ b/test/unit/activation-generator_t.c @@ -137,9 +137,9 @@ static void _test_parse_line(void *fixture) if (!r) test_fail("_parse_line('%s') failed", t->input); - //if (cfg.event_activation != t->event_activation) - // test_fail("_parse_line('%s') -> event_activation='%s'", - // t->input, _bool(cfg.event_activation)); + if (cfg.event_activation != t->event_activation) + test_fail("_parse_line('%s') -> event_activation='%s'", + t->input, _bool(cfg.event_activation)); if (cfg.sysinit_needed != t->sysinit_needed) test_fail("_parse_line('%s') -> sysinit_needed='%s'", @@ -180,7 +180,7 @@ static const char *_fake_lvmconfig(const char *output) if (!fp) return NULL; - fprintf(fp, "#!/usr/bin/sh\n"); + fprintf(fp, "#!/usr/bin/env bash\n"); fprintf(fp, "cat <output); - //if (t->event_activation != cfg.event_activation) - // test_fail("_get_config() <- '%s', event_activation = %s", - // t->output, _bool(cfg.event_activation)); + if (t->event_activation != cfg.event_activation) + test_fail("_get_config() <- '%s', event_activation = %s", + t->output, _bool(cfg.event_activation)); if (t->sysinit_needed != cfg.sysinit_needed) test_fail("_get_config() <- '%s', sysinit = %s", -- 2.43.5