define and start using single_text_context()

This commit is contained in:
jlamothe
2023-11-16 00:52:01 +00:00
parent ef00063ba3
commit 0ad79ea3b0
4 changed files with 57 additions and 23 deletions

View File

@@ -46,18 +46,17 @@ decl_test(initial_report);
void
test_initial_state(TestState *s)
{
print("initial state\n");
run_test(s, initial_test_count);
run_test(s, initial_pass_count);
run_test(s, initial_fail_count);
run_test(s, initial_pend_count);
run_test(s, initial_first_log);
run_test(s, initial_last_log);
run_test(s, initial_ptr);
run_test(s, initial_context);
run_test(s, initial_full_context);
run_test(s, initial_depth);
run_test(s, initial_report);
single_test_context(s, "run", initial_test_count);
single_test_context(s, "passsed", initial_pass_count);
single_test_context(s, "failed", initial_fail_count);
single_test_context(s, "pending", initial_pend_count);
single_test_context(s, "first_log", initial_first_log);
single_test_context(s, "last_log", initial_last_log);
single_test_context(s, "ptr", initial_ptr);
single_test_context(s, "context", initial_context);
single_test_context(s, "full_context", initial_full_context);
single_test_context(s, "depth", initial_depth);
single_test_context(s, "report()", initial_report);
}
// Internal Functions
@@ -65,7 +64,6 @@ test_initial_state(TestState *s)
def_test(initial_test_count, s)
{
TestState *scpy = s->ptr;
print("\trun\n");
if (scpy->run == 0) return test_success;
append_test_log(s, "initial run was nonzero");
return test_failure;
@@ -83,7 +81,6 @@ def_test(initial_pass_count, s)
def_test(initial_fail_count, s)
{
TestState *scpy = s->ptr;
print("\tfailed\n");
if (scpy->failed == 0) return test_success;
append_test_log(s, "initial failed was nonzero");
return test_failure;
@@ -101,7 +98,6 @@ def_test(initial_pend_count, s)
def_test(initial_first_log, s)
{
TestState *scpy = s->ptr;
print("\tfirst_log\n");
if (scpy->first_log == 0) return test_success;
append_test_log(s, "initial first_log was not null");
return test_failure;
@@ -110,7 +106,6 @@ def_test(initial_first_log, s)
def_test(initial_last_log, s)
{
TestState *scpy = s->ptr;
print("\tlast_log\n");
if (scpy->last_log == 0) return test_success;
append_test_log(s, "initial last_log was not null");
return test_failure;
@@ -119,7 +114,6 @@ def_test(initial_last_log, s)
def_test(initial_ptr, s)
{
TestState *scpy = s->ptr;
print("\tptr\n");
if (scpy->ptr == 0) return test_success;
append_test_log(s, "initial ptr was not null");
return test_failure;
@@ -128,7 +122,6 @@ def_test(initial_ptr, s)
def_test(initial_context, s)
{
TestState *scpy = s->ptr;
print("\tcontext\n");
if (scpy->context == 0) return test_success;
append_test_log(s, "initial context was not null");
return test_failure;
@@ -137,7 +130,6 @@ def_test(initial_context, s)
def_test(initial_full_context, s)
{
TestState *scpy = s->ptr;
print("\tfull_context\n");
if (scpy->context == 0) return test_success;
append_test_log(s, "initial full_context was not null");
return test_failure;
@@ -146,7 +138,6 @@ def_test(initial_full_context, s)
def_test(initial_depth, s)
{
TestState *scpy = s->ptr;
print("\tdepth\n");
if (scpy->depth == 0) return test_success;
append_test_log(s, "initial depth was not zero");
return test_failure;
@@ -155,7 +146,6 @@ def_test(initial_depth, s)
def_test(initial_report, s)
{
TestState *scpy = s->ptr;
print("\treport()\n");
if (scpy->report != 0) return test_success;
append_test_log(s, "initial report was null");
return test_failure;

View File

@@ -53,7 +53,7 @@ tests(TestState *s)
memcpy(&scpy, s, sizeof(TestState));
s->ptr = &scpy;
test_initial_state(s);
test_context(s, "initial state", test_initial_state);
test_run_test(s);
test_append_test_log(s);
test_context(s, "test_context()", test_test_context);