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

START_TEST(test_ok)
{
    fail_unless(1, "test intentionally failed");
}
END_TEST

static Suite *suite()
{
    Suite *s = suite_create("looptest");
    TCase *tc = tcase_create("loop1");
    suite_add_tcase(s, tc);
    tcase_add_loop_test(tc, test_ok, 0, 5);

    return s;
}

int main()
{
    if ((check_major_version != CHECK_MAJOR_VERSION)
	|| (check_minor_version != CHECK_MINOR_VERSION)
	|| (check_micro_version != CHECK_MICRO_VERSION))
	printf("WARNING: check version mismatch\n");
    int nf;
    Suite *s = suite();
    SRunner *sr = srunner_create(s);
    srunner_run_all(sr, CK_NORMAL);
    nf = srunner_ntests_failed(sr);
    srunner_free(sr);
    return nf == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
