Got the suite rebuilding, most tests pass, actor and sprite are failing

This commit is contained in:
2026-05-03 23:57:55 -04:00
parent f475dfb6ee
commit 6763b5629f
36 changed files with 734 additions and 664 deletions

View File

@@ -5,7 +5,7 @@
void reset_string_heap(void);
ErrorContext *test_fresh_heap_gives_strings(void)
akerr_ErrorContext *test_fresh_heap_gives_strings(void)
{
string *ptr = NULL;
@@ -22,7 +22,7 @@ ErrorContext *test_fresh_heap_gives_strings(void)
return 0;
}
ErrorContext *test_string_heap_error_when_no_strings_left(void)
akerr_ErrorContext *test_string_heap_error_when_no_strings_left(void)
{
string *ptr;
PREPARE_ERROR(errctx);
@@ -34,15 +34,15 @@ ErrorContext *test_string_heap_error_when_no_strings_left(void)
CATCH(errctx, heap_next_string(&ptr));
} CLEANUP {
} PROCESS(errctx) {
} HANDLE(errctx, ERR_NULLPOINTER) {
} HANDLE(errctx, AKERR_NULLPOINTER) {
return 0;
} FINISH(errctx, true);
}
FAIL_RETURN(errctx, ERR_OUTOFBOUNDS, "Expected ERR_NULLPOINTER when accessing beyond string heap bounds");
FAIL_RETURN(errctx, AKERR_OUTOFBOUNDS, "Expected AKERR_NULLPOINTER when accessing beyond string heap bounds");
SUCCEED_RETURN(errctx);
}
ErrorContext *test_string_heap_honors_refcount(void)
akerr_ErrorContext *test_string_heap_honors_refcount(void)
{
string *firstptr = &HEAP_STRING[0];
string *secondptr = &HEAP_STRING[1];
@@ -53,7 +53,7 @@ ErrorContext *test_string_heap_honors_refcount(void)
if ( testptr != firstptr ) {
FAIL_RETURN(
errctx,
ERR_VALUE,
AKERR_VALUE,
"Expected testptr to equal (HEAP_STRING[0] = %p) but got %p",
firstptr,
testptr
@@ -61,12 +61,12 @@ ErrorContext *test_string_heap_honors_refcount(void)
}
CATCH(errctx, string_initialize(testptr, NULL));
if ( testptr->refcount == 0 ) {
FAIL_RETURN(errctx, ERR_VALUE, "Expected string reference count to be nonzero but got 0");
FAIL_RETURN(errctx, AKERR_VALUE, "Expected string reference count to be nonzero but got 0");
}
if ( testptr != firstptr ) {
FAIL_RETURN(
errctx,
ERR_VALUE,
AKERR_VALUE,
"Expected testptr to equal (HEAP_STRING[1] = %p) but got %p",
secondptr,
testptr
@@ -79,7 +79,7 @@ ErrorContext *test_string_heap_honors_refcount(void)
SUCCEED_RETURN(errctx);
}
ErrorContext *test_strcpy_to_all_strings_no_segfault(void)
akerr_ErrorContext *test_strcpy_to_all_strings_no_segfault(void)
{
char copybuf[MAX_STRING_LENGTH];
string *ptr;
@@ -96,22 +96,22 @@ ErrorContext *test_strcpy_to_all_strings_no_segfault(void)
SUCCEED_RETURN(errctx);
}
ErrorContext *test_string_initialize(void)
akerr_ErrorContext *test_string_initialize(void)
{
string *ptr;
PREPARE_ERROR(errctx);
ATTEMPT {
CATCH(errctx, heap_next_string(&ptr));
CATCH(errctx, string_initialize(ptr, NULL));
FAIL_NONZERO_BREAK(errctx, ptr->data[0], ERR_VALUE, "Expected empty zero length string data");
FAIL_NONZERO_BREAK(errctx, ptr->data[0], AKERR_VALUE, "Expected empty zero length string data");
CATCH(errctx, heap_release_string(ptr));
CATCH(errctx, heap_next_string(&ptr));
CATCH(errctx, string_initialize(ptr, "Test value"));
FAIL_NONZERO_BREAK(errctx, strcmp((char *)&ptr->data, "Test value"), ERR_VALUE, "Expected 'Test value', got %s", (char *)&ptr->data);
FAIL_NONZERO_BREAK(errctx, strcmp((char *)&ptr->data, "Test value"), AKERR_VALUE, "Expected 'Test value', got %s", (char *)&ptr->data);
CATCH(errctx, heap_release_string(NULL));
FAIL_BREAK(errctx, ERR_BEHAVIOR, "Failure to properly handle NULL pointer");
FAIL_BREAK(errctx, AKERR_BEHAVIOR, "Failure to properly handle NULL pointer");
} CLEANUP {
} PROCESS(errctx) {
} FINISH(errctx, true);