static test_return_t var_tmp_test(void *)
{
FILE *file= fopen("var/tmp/junk", "w+");
- char buffer[1024];
test_true(file);
fclose(file);
return TEST_SUCCESS;
return TEST_SUCCESS;
}
+static test_return_t Timer_TEST(void *)
+{
+ int64_t minutes= random() % 50;
+ minutes++;
+
+ Timer check;
+
+ check.reset();
+ check.offset(minutes, 2, 200);
+
+ test_compare(check.minutes(), minutes);
+
+ return TEST_SUCCESS;
+}
+
static test_return_t lookup_true_TEST(void *)
{
test_warn(libtest::lookup("exist.gearman.info"), "dns is not currently working");
{0, 0, 0}
};
+test_st timer_TESTS[] ={
+ {"libtest::Timer", 0, Timer_TEST },
+ {0, 0, 0}
+};
+
test_st dns_TESTS[] ={
{"libtest::lookup(true)", 0, lookup_true_TEST },
{"libtest::lookup(false)", 0, lookup_false_TEST },
{"number_of_cpus()", 0, 0, number_of_cpus_TESTS },
{"create_tmpfile()", 0, 0, create_tmpfile_TESTS },
{"dns", 0, 0, dns_TESTS },
+ {"libtest::Timer", 0, 0, timer_TESTS },
{0, 0, 0, 0}
};