2012-10-19 18:10:30 +04:00
|
|
|
#include "torture.h"
|
2008-05-09 11:26:12 +04:00
|
|
|
|
|
|
|
#include "csync_util.h"
|
|
|
|
|
2012-10-19 18:10:30 +04:00
|
|
|
static void check_csync_instruction_str(void **state)
|
2008-05-09 11:26:12 +04:00
|
|
|
{
|
2012-10-19 18:10:30 +04:00
|
|
|
const char *str;
|
|
|
|
|
|
|
|
(void) state; /* unused */
|
2008-05-09 11:26:12 +04:00
|
|
|
|
|
|
|
str = csync_instruction_str(CSYNC_INSTRUCTION_ERROR);
|
2012-10-19 18:10:30 +04:00
|
|
|
assert_string_equal(str, "INSTRUCTION_ERROR");
|
2008-05-09 11:26:12 +04:00
|
|
|
|
|
|
|
str = csync_instruction_str(0xFFFF);
|
2012-10-19 18:10:30 +04:00
|
|
|
assert_string_equal(str, "ERROR!");
|
2008-05-09 11:26:12 +04:00
|
|
|
}
|
|
|
|
|
2012-10-19 18:10:30 +04:00
|
|
|
static void check_csync_memstat(void **state)
|
2008-05-09 11:26:12 +04:00
|
|
|
{
|
2012-10-19 18:10:30 +04:00
|
|
|
(void) state; /* unused */
|
2008-05-09 11:26:12 +04:00
|
|
|
|
2012-10-27 18:05:16 +04:00
|
|
|
csync_memstat_check(NULL);
|
2008-05-09 11:26:12 +04:00
|
|
|
}
|
|
|
|
|
2012-10-19 18:10:30 +04:00
|
|
|
int torture_run_tests(void)
|
|
|
|
{
|
|
|
|
const UnitTest tests[] = {
|
|
|
|
unit_test(check_csync_instruction_str),
|
|
|
|
unit_test(check_csync_memstat),
|
|
|
|
};
|
2008-05-09 11:26:12 +04:00
|
|
|
|
2012-10-19 18:10:30 +04:00
|
|
|
return run_tests(tests);
|
2008-05-09 11:26:12 +04:00
|
|
|
}
|
|
|
|
|