Skip to content

Commit

Permalink
JUNK debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
elliefm committed Jun 29, 2023
1 parent 09cab6b commit bb52d69
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cunit/libconfig.testc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
#include <sysexits.h>
Expand Down Expand Up @@ -489,6 +490,14 @@ static void test_duration_parse(void)
const struct duration_parse_data *test = &duration_parse_tests[i];
int duration = 0xdeadbeef;
int r = config_parseduration(test->str, 's', &duration);
if (verbose && (r != test->expected_result
|| duration != test->expected_duration))
{
fprintf(stderr, "%s: expected(%d -> %d), got (%d -> %d)\n",
test->str,
test->expected_result, test->expected_duration,
r, duration);
}
CU_ASSERT_EQUAL(r, test->expected_result);
CU_ASSERT_EQUAL(duration, test->expected_duration);
}
Expand Down Expand Up @@ -795,6 +804,14 @@ static void test_bytesize_parse(void)
const struct bytesize_parse_data *test = &bytesize_parse_tests[i];
int64_t bytesize = 0xdeadbeefLL;
int r = config_parsebytesize(test->str, 'B', &bytesize);
if (verbose && (r != test->expected_result
|| bytesize != test->expected_bytesize))
{
fprintf(stderr, "%s: expected(%d -> %" PRId64 "), got (%d -> %" PRId64 ")\n",
test->str,
test->expected_result, test->expected_bytesize,
r, bytesize);
}
CU_ASSERT_EQUAL(r, test->expected_result);
CU_ASSERT_EQUAL(bytesize, test->expected_bytesize);
}
Expand Down

0 comments on commit bb52d69

Please sign in to comment.