<commit_before>#pragma once

#include <stdio.h>

#if !defined(_ZF_TEST_STRINGIFY) && !defined(_ZF_TEST__STRINGIFY)
#define _ZF_TEST__STRINGIFY(x) #x
#define _ZF_TEST_STRINGIFY(x) _ZF_TEST__STRINGIFY(x)
#endif

typedef struct _zf_test_runner
{
    unsigned nerror;
}
_zf_test_runner;

#define TEST_RUNNER_CREATE(argc, argv) \
    (void)argc; (void)argv; \
    _zf_test_runner _zf_test_runner_instance; \
    _zf_test_runner_instance.nerror = 0;

#define TEST_SUIT_ARGUMENTS

#define TEST_VERIFY_TRUE(a) \
    if (!(a)) { \
        fprintf(stderr, "%s:%u: %s:\n", __FILE__, __LINE__, "not true"); \
        fprintf(stderr, "    false: %s\n", _ZF_TEST_STRINGIFY(a)); \
    }

#define TEST_VERIFY_FALSE(a) \
    if ((a)) { \
        fprintf(stderr, "%s:%u: %s:\n", __FILE__, __LINE__, "not false"); \
        fprintf(stderr, "    true: %s\n", _ZF_TEST_STRINGIFY(a)); \
    }

#define TEST_VERIFY_EQUAL(a, b) \
    if (!((a) == (b))) { \
        fprintf(stderr, "%s:%u: %s:\n", __FILE__, __LINE__, "not equal"); \
        fprintf(stderr, "    left:   %s\n", _ZF_TEST_STRINGIFY(a)); \
        fprintf(stderr, "    reight: %s\n", _ZF_TEST_STRINGIFY(b)); \
    }

#define TEST_EXECUTE(f) \
    f

#define TEST_EXECUTE_SUITE(s) \
    s()

#define TEST_RUNNER_EXIT_CODE() \
    0<commit_msg>Fix C tests (exit with non-0 on failure)<commit_after>#pragma once

#include <stdio.h>
#include <stdlib.h>

#if !defined(_ZF_TEST_STRINGIFY) && !defined(_ZF_TEST__STRINGIFY)
#define _ZF_TEST__STRINGIFY(x) #x
#define _ZF_TEST_STRINGIFY(x) _ZF_TEST__STRINGIFY(x)
#endif

#define TEST_RUNNER_CREATE(argc, argv) \
	(void)argc; (void)argv;

#define TEST_SUIT_ARGUMENTS

#define TEST_VERIFY_TRUE(a) \
	if (!(a)) { \
		fprintf(stderr, "%s:%u: %s:\n", __FILE__, __LINE__, "not true"); \
		fprintf(stderr, "    false: %s\n", _ZF_TEST_STRINGIFY(a)); \
		exit(1); \
	}

#define TEST_VERIFY_FALSE(a) \
	if ((a)) { \
		fprintf(stderr, "%s:%u: %s:\n", __FILE__, __LINE__, "not false"); \
		fprintf(stderr, "    true: %s\n", _ZF_TEST_STRINGIFY(a)); \
		exit(1); \
	}

#define TEST_VERIFY_EQUAL(a, b) \
	if (!((a) == (b))) { \
		fprintf(stderr, "%s:%u: %s:\n", __FILE__, __LINE__, "not equal"); \
		fprintf(stderr, "    left:   %s\n", _ZF_TEST_STRINGIFY(a)); \
		fprintf(stderr, "    reight: %s\n", _ZF_TEST_STRINGIFY(b)); \
		exit(1); \
	}

#define TEST_EXECUTE(f) \
	f

#define TEST_EXECUTE_SUITE(s) \
	s()

#define TEST_RUNNER_EXIT_CODE() \
	0
{'fraction_non_alphanumeric': 0.18125259228535878, 'fraction_numerical': 0.002903359601824969, 'mean_word_length': 3.882591093117409, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6151740', 'n_tokens_mistral': 1035, 'n_tokens_neox': 1037, 'n_words': 183}