From 95672b2e7a6cc0c07306893d5bb0b80ee3570f7a Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 12 Aug 2024 15:11:17 -0400 Subject: More unit tests (and fixing bugs) (#23) * Add test_artifactory.c to suite * Add test_ini_getval_wrapper to ini.c * basic ini_getval_TYPE() conversion checks * bugfix: use strtof in INIVAL_TYPE_FLOAT case * Include stdio.h to pull in FILE structure * bugfix: free data at index during strlist_set operation * Previous behavior of setting the pointer to NULL introduced a subtle memory leak * Set strlist error when index it out of range * Import private delivery functions required for mock context creation * Remove static declaration * populate_delivery_cfg() * Add test_junitxml.c * Fix duplicate define value for JUNIT_RESULT_STATE_ERROR * Add static junit test data * Copy test data to current test directory --- tests/data/result.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/data/result.xml (limited to 'tests/data/result.xml') diff --git a/tests/data/result.xml b/tests/data/result.xml new file mode 100644 index 0000000..81df70f --- /dev/null +++ b/tests/data/result.xml @@ -0,0 +1,10 @@ +/example/test_simple.py:4: unconditional skipdef test_fail(): + print("oh no, this test failed.", file=sys.stderr) +> assert False +E assert False + +test_simple.py:10: AssertionErrordef test_error(): +> raise RuntimeError("uh oh, a runtime error") +E RuntimeError: uh oh, a runtime error + +test_simple.py:17: RuntimeError -- cgit