diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-11-01 00:55:19 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-11-01 08:35:19 -0400 |
commit | 35d0480f743abaa5c2c332f513043edd7c59081c (patch) | |
tree | 0e4071402281e44e492df78292002adad0c997d2 /tests/test_junitxml.c | |
parent | d4cbcbfb77476ba8f21b82c608322af80cd6a303 (diff) | |
download | stasis-35d0480f743abaa5c2c332f513043edd7c59081c.tar.gz |
Initialize structs to {0} and combine declaration and assignment where possible
Diffstat (limited to 'tests/test_junitxml.c')
-rw-r--r-- | tests/test_junitxml.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_junitxml.c b/tests/test_junitxml.c index e222b56..362cb32 100644 --- a/tests/test_junitxml.c +++ b/tests/test_junitxml.c @@ -3,7 +3,10 @@ void test_junitxml_testsuite_read() { struct JUNIT_Testsuite *testsuite; - STASIS_ASSERT_FATAL((testsuite = junitxml_testsuite_read("data/result.xml")) != NULL, "failed to load testsuite data"); + char datafile[PATH_MAX] = {0}; + snprintf(datafile, sizeof(datafile) - 1, "%s/result.xml", TEST_DATA_DIR); + + STASIS_ASSERT_FATAL((testsuite = junitxml_testsuite_read(datafile)) != NULL, "failed to load testsuite data"); STASIS_ASSERT(testsuite->name != NULL, "Test suite must be named"); STASIS_ASSERT(testsuite->skipped > 0, "missed skipped tests"); STASIS_ASSERT(testsuite->failures > 0, "missed failed tests"); @@ -44,7 +47,9 @@ void test_junitxml_testsuite_read() { void test_junitxml_testsuite_read_error() { struct JUNIT_Testsuite *testsuite; - STASIS_ASSERT_FATAL((testsuite = junitxml_testsuite_read("data/result_error.xml")) != NULL, "failed to load testsuite data"); + char datafile[PATH_MAX] = {0}; + snprintf(datafile, sizeof(datafile) - 1, "%s/result_error.xml", TEST_DATA_DIR); + STASIS_ASSERT_FATAL((testsuite = junitxml_testsuite_read(datafile)) != NULL, "failed to load testsuite data"); STASIS_ASSERT(testsuite->name != NULL, "test suite must be named"); STASIS_ASSERT(testsuite->skipped == 0, "should not have any skipped tests"); |