test test_context() with a prior context
This commit is contained in:
parent
ebf398fd33
commit
da33bd8955
|
@ -47,6 +47,7 @@ struct ContextData
|
|||
// Internal Prototypes
|
||||
|
||||
static void no_prior_context(TestState *);
|
||||
static void prior_context(TestState *);
|
||||
static void test_context_common(TestState *, ContextData *);
|
||||
static void init_ContextData(ContextData *);
|
||||
static void get_context(TestState *);
|
||||
|
@ -59,6 +60,7 @@ void
|
|||
test_test_context(TestState *s)
|
||||
{
|
||||
test_context(s, "no prior context", no_prior_context);
|
||||
test_context(s, "prior context", prior_context);
|
||||
}
|
||||
|
||||
// Internal Functions
|
||||
|
@ -81,6 +83,24 @@ no_prior_context(TestState *s)
|
|||
test_context_common(s, &cd);
|
||||
}
|
||||
|
||||
static void
|
||||
prior_context(TestState *s)
|
||||
{
|
||||
ContextData cd;
|
||||
|
||||
// set initial state
|
||||
cd.new_context = "my other test";
|
||||
cd.initial_context = "bar";
|
||||
cd.initial_full_context = "foo: bar";
|
||||
cd.initial_depth = 2;
|
||||
|
||||
// set expectations
|
||||
cd.expected_sub_full_context = "foo: bar: my other test";
|
||||
cd.expected_sub_depth = 3;
|
||||
|
||||
test_context_common(s, &cd);
|
||||
}
|
||||
|
||||
static void
|
||||
test_context_common(
|
||||
TestState *s,
|
||||
|
|
Loading…
Reference in New Issue
Block a user