moved mk_sample_state() into util

This commit is contained in:
jlamothe 2023-11-10 20:48:40 +00:00
parent a962eff7b4
commit 4c0d33693b
3 changed files with 13 additions and 11 deletions

View File

@ -31,7 +31,6 @@
static void test_pass(TestState *);
static void test_fail(TestState *);
static void test_pend(TestState *);
static void mk_sample_state(TestState *);
decl_test(always_passes);
decl_test(always_fails);
decl_test(always_pends);
@ -127,16 +126,6 @@ test_pend(TestState *s)
);
}
static void
mk_sample_state(TestState *s)
{
memset(s, 0, sizeof(TestState));
s->passed = 1;
s->failed = 2;
s->pending = 3;
s->run = 6;
}
decl_test(always_passes)
{
return test_success;

View File

@ -131,6 +131,16 @@ decl_test(compare_ptrs_test);
// Public Functions
void
mk_sample_state(TestState *s)
{
memset(s, 0, sizeof(TestState));
s->passed = 1;
s->failed = 2;
s->pending = 3;
s->run = 6;
}
void
compare_states(
TestState *s,

View File

@ -24,6 +24,9 @@
#define decl_test(n) static TestResult n(TestState *)
#define def_test(n, s) static TestResult n(TestState *s)
// initializes a sample TestState value
void mk_sample_state(TestState *);
// compares two TestState values
extern void compare_states(
TestState *, // the state we are *actually* updating ;)