Clamp keyframe interpolation to last value, add main menu scene/UI, battle HUD, and expanded test coverage
- keyframeGetValue now returns the last keyframe's value for times at or beyond it, fixes a missing util/math.h include, and asserts keyframes are sorted by time; adds test/animation/test_keyframe.c - Adds mainmenu scene/UI and a battle HUD UI frame - Adds save autosave-related fields and battle scene tweaks - Adds headless test coverage for cutscenes, entities, and map areas
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
# Copyright (c) 2026 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
include(dusktest)
|
||||
|
||||
# Tests
|
||||
dusktest(test_cutscenesystem.c)
|
||||
dusktest(test_cutscenecontrol.c)
|
||||
dusktest(test_cutscenemaparea.c)
|
||||
@@ -0,0 +1,142 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "dusktest.h"
|
||||
#include "rpg/cutscene/cutscenesystem.h"
|
||||
#include "time/time.h"
|
||||
#include "util/memory.h"
|
||||
|
||||
static void test_cutsceneWaitCompletesAfterItsDuration(void **state) {
|
||||
|
||||
cutsceneitem_t item = CUTSCENE_WAIT(1.0f);
|
||||
cutsceneitemdata_t data;
|
||||
memoryZero(&data, sizeof(data));
|
||||
|
||||
cutsceneWaitStart(&item, &data);
|
||||
|
||||
TIME.delta = 0.5f;
|
||||
assert_false(cutsceneWaitUpdate(&item, &data));
|
||||
|
||||
TIME.delta = 0.6f;
|
||||
assert_true(cutsceneWaitUpdate(&item, &data));
|
||||
}
|
||||
|
||||
static void *lastUserData;
|
||||
static uint8_t callbackCallCount;
|
||||
|
||||
static void recordCallback(void *userData) {
|
||||
lastUserData = userData;
|
||||
callbackCallCount++;
|
||||
}
|
||||
|
||||
static void test_cutsceneCallbackFiresOnStartWithUserData(void **state) {
|
||||
|
||||
callbackCallCount = 0;
|
||||
lastUserData = NULL;
|
||||
|
||||
cutsceneitem_t item = CUTSCENE_CALLBACK(recordCallback);
|
||||
cutsceneitemdata_t data;
|
||||
|
||||
cutsceneCallbackStart(&item, &data);
|
||||
assert_int_equal(callbackCallCount, 1);
|
||||
assert_ptr_equal(lastUserData, CUTSCENE_SYSTEM.userData);
|
||||
|
||||
// Callback items always complete immediately -- the effect already
|
||||
// happened in Start, not Update.
|
||||
assert_true(cutsceneCallbackUpdate(&item, &data));
|
||||
assert_int_equal(callbackCallCount, 1);// Update doesn't fire it again
|
||||
}
|
||||
|
||||
static void test_cutsceneCallbackNullIsNoop(void **state) {
|
||||
|
||||
callbackCallCount = 0;
|
||||
cutsceneitem_t item = { .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = NULL };
|
||||
cutsceneitemdata_t data;
|
||||
|
||||
cutsceneCallbackStart(&item, &data);// should not crash
|
||||
assert_int_equal(callbackCallCount, 0);
|
||||
}
|
||||
|
||||
static void test_cutsceneSetPauseAppliesImmediately(void **state) {
|
||||
|
||||
CUTSCENE_SYSTEM.pause = CUTSCENE_PAUSE_NONE;
|
||||
cutsceneitem_t item =
|
||||
CUTSCENE_SET_PAUSE(CUTSCENE_PAUSE_NPC | CUTSCENE_PAUSE_BATTLE);
|
||||
cutsceneitemdata_t data;
|
||||
|
||||
cutsceneSetPauseStart(&item, &data);
|
||||
assert_int_equal(
|
||||
CUTSCENE_SYSTEM.pause, CUTSCENE_PAUSE_NPC | CUTSCENE_PAUSE_BATTLE
|
||||
);
|
||||
assert_true(cutsceneSetPauseUpdate(&item, &data));
|
||||
}
|
||||
|
||||
static void test_cutsceneConcurrentCompletesOnceAllChildrenDo(void **state) {
|
||||
|
||||
cutsceneitem_t item = CUTSCENE_CONCURRENT(
|
||||
CUTSCENE_WAIT(0.2f),
|
||||
CUTSCENE_WAIT(0.5f)
|
||||
);
|
||||
cutsceneitemdata_t data;
|
||||
memoryZero(&data, sizeof(data));
|
||||
|
||||
cutsceneConcurrentStart(&item, &data);
|
||||
|
||||
TIME.delta = 0.3f;
|
||||
// Child 0 (0.2s) elapses; child 1 (0.5s) still has 0.2s left.
|
||||
assert_false(cutsceneConcurrentUpdate(&item, &data));
|
||||
|
||||
TIME.delta = 0.3f;
|
||||
// Child 1 now elapses too.
|
||||
assert_true(cutsceneConcurrentUpdate(&item, &data));
|
||||
}
|
||||
|
||||
static void test_cutsceneConcurrentDoesNotReUpdateFinishedChildren(
|
||||
void **state
|
||||
) {
|
||||
|
||||
cutsceneitem_t item = CUTSCENE_CONCURRENT(
|
||||
CUTSCENE_WAIT(0.1f),
|
||||
CUTSCENE_WAIT(10.0f)
|
||||
);
|
||||
cutsceneitemdata_t data;
|
||||
memoryZero(&data, sizeof(data));
|
||||
|
||||
cutsceneConcurrentStart(&item, &data);
|
||||
|
||||
TIME.delta = 0.2f;
|
||||
cutsceneConcurrentUpdate(&item, &data);// child 0 finishes
|
||||
|
||||
// If child 0 were re-updated, its stored wait value would keep dropping
|
||||
// further below zero -- not observable directly, but the overall result
|
||||
// must not falsely report done just because child 0 keeps completing.
|
||||
TIME.delta = 0.2f;
|
||||
assert_false(cutsceneConcurrentUpdate(&item, &data));
|
||||
}
|
||||
|
||||
static void test_cutsceneConcurrentCannotNest(void **state) {
|
||||
|
||||
cutsceneitem_t outer =
|
||||
CUTSCENE_CONCURRENT(CUTSCENE_CONCURRENT(CUTSCENE_WAIT(1.0f)));
|
||||
cutsceneitemdata_t data;
|
||||
|
||||
expect_assert_failure(cutsceneConcurrentStart(&outer, &data));
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
const struct CMUnitTest tests[] = {
|
||||
cmocka_unit_test(test_cutsceneWaitCompletesAfterItsDuration),
|
||||
cmocka_unit_test(test_cutsceneCallbackFiresOnStartWithUserData),
|
||||
cmocka_unit_test(test_cutsceneCallbackNullIsNoop),
|
||||
cmocka_unit_test(test_cutsceneSetPauseAppliesImmediately),
|
||||
cmocka_unit_test(test_cutsceneConcurrentCompletesOnceAllChildrenDo),
|
||||
cmocka_unit_test(test_cutsceneConcurrentDoesNotReUpdateFinishedChildren),
|
||||
cmocka_unit_test(test_cutsceneConcurrentCannotNest),
|
||||
};
|
||||
|
||||
return cmocka_run_group_tests(tests, NULL, NULL);
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "dusktest.h"
|
||||
#include "rpg/cutscene/cutscenesystem.h"
|
||||
#include "rpg/overworld/maparea.h"
|
||||
#include "util/memory.h"
|
||||
|
||||
static void resetMapAreas(void) {
|
||||
memoryZero(MAP_AREAS, sizeof(MAP_AREAS));
|
||||
}
|
||||
|
||||
static void test_cutsceneMapAreaAddCreatesAreaAndStoresLastCreated(
|
||||
void **state
|
||||
) {
|
||||
|
||||
resetMapAreas();
|
||||
cutsceneitem_t item = CUTSCENE_MAP_AREA_ADD(
|
||||
0, 0, 0, 5, 5, 0, mapAreaNoopCallback, MAP_AREA_NOTIFY_ALL, MAP_TRIGGER_ALL
|
||||
);
|
||||
cutsceneitemdata_t data;
|
||||
|
||||
cutsceneMapAreaAddStart(&item, &data);
|
||||
assert_true(cutsceneMapAreaAddUpdate(&item, &data));
|
||||
|
||||
uint8_t id = CUTSCENE_SYSTEM.areaLastCreated;
|
||||
assert_ptr_equal(MAP_AREAS[id].callback, mapAreaNoopCallback);
|
||||
assert_int_equal(MAP_AREAS[id].max.x, 5);
|
||||
}
|
||||
|
||||
static void test_cutsceneMapAreaRemoveClearsSlot(void **state) {
|
||||
|
||||
resetMapAreas();
|
||||
uint8_t id = mapAreaAdd(
|
||||
(worldpos_t){ 0, 0, 0 }, (worldpos_t){ 5, 5, 0 },
|
||||
mapAreaNoopCallback, MAP_AREA_NOTIFY_ALL, MAP_TRIGGER_ALL
|
||||
);
|
||||
|
||||
cutsceneitem_t item = CUTSCENE_MAP_AREA_REMOVE(id);
|
||||
cutsceneitemdata_t data;
|
||||
|
||||
cutsceneMapAreaRemoveStart(&item, &data);
|
||||
assert_true(cutsceneMapAreaRemoveUpdate(&item, &data));
|
||||
assert_null(MAP_AREAS[id].callback);
|
||||
}
|
||||
|
||||
static void test_cutsceneMapAreaRemoveResolvesLastCreatedSentinel(
|
||||
void **state
|
||||
) {
|
||||
|
||||
resetMapAreas();
|
||||
cutsceneitem_t addItem = CUTSCENE_MAP_AREA_ADD(
|
||||
0, 0, 0, 5, 5, 0, mapAreaNoopCallback, MAP_AREA_NOTIFY_ALL, MAP_TRIGGER_ALL
|
||||
);
|
||||
cutsceneitemdata_t data;
|
||||
cutsceneMapAreaAddStart(&addItem, &data);
|
||||
uint8_t id = CUTSCENE_SYSTEM.areaLastCreated;
|
||||
|
||||
cutsceneitem_t removeItem = CUTSCENE_MAP_AREA_REMOVE(CUTSCENE_AREA_LAST_CREATED);
|
||||
cutsceneMapAreaRemoveStart(&removeItem, &data);
|
||||
assert_null(MAP_AREAS[id].callback);
|
||||
}
|
||||
|
||||
static void test_cutsceneMapAreaWaitCompletesWhenTriggerCountChanges(
|
||||
void **state
|
||||
) {
|
||||
|
||||
resetMapAreas();
|
||||
uint8_t id = mapAreaAdd(
|
||||
(worldpos_t){ 0, 0, 0 }, (worldpos_t){ 5, 5, 0 },
|
||||
mapAreaNoopCallback, MAP_AREA_NOTIFY_ALL, MAP_TRIGGER_ALL
|
||||
);
|
||||
|
||||
cutsceneitem_t item = CUTSCENE_MAP_AREA_WAIT(id);
|
||||
cutsceneitemdata_t data;
|
||||
|
||||
cutsceneMapAreaWaitStart(&item, &data);
|
||||
assert_false(cutsceneMapAreaWaitUpdate(&item, &data));
|
||||
|
||||
MAP_AREAS[id].triggerCount++;// simulates the area's callback firing
|
||||
assert_true(cutsceneMapAreaWaitUpdate(&item, &data));
|
||||
}
|
||||
|
||||
static void test_cutsceneMapAreaWaitCompletesWhenAnyWatchedAreaChanges(
|
||||
void **state
|
||||
) {
|
||||
|
||||
resetMapAreas();
|
||||
uint8_t idA = mapAreaAdd(
|
||||
(worldpos_t){ 0, 0, 0 }, (worldpos_t){ 5, 5, 0 },
|
||||
mapAreaNoopCallback, MAP_AREA_NOTIFY_ALL, MAP_TRIGGER_ALL
|
||||
);
|
||||
uint8_t idB = mapAreaAdd(
|
||||
(worldpos_t){ 10, 10, 0 }, (worldpos_t){ 15, 15, 0 },
|
||||
mapAreaNoopCallback, MAP_AREA_NOTIFY_ALL, MAP_TRIGGER_ALL
|
||||
);
|
||||
|
||||
cutsceneitem_t item = CUTSCENE_MAP_AREA_WAIT(idA, idB);
|
||||
cutsceneitemdata_t data;
|
||||
|
||||
cutsceneMapAreaWaitStart(&item, &data);
|
||||
assert_false(cutsceneMapAreaWaitUpdate(&item, &data));
|
||||
|
||||
MAP_AREAS[idB].triggerCount++;// only the second watched area fires
|
||||
assert_true(cutsceneMapAreaWaitUpdate(&item, &data));
|
||||
}
|
||||
|
||||
static void test_cutsceneMapAreaWaitResolvesLastCreatedSentinel(
|
||||
void **state
|
||||
) {
|
||||
|
||||
resetMapAreas();
|
||||
cutsceneitem_t addItem = CUTSCENE_MAP_AREA_ADD(
|
||||
0, 0, 0, 5, 5, 0, mapAreaNoopCallback, MAP_AREA_NOTIFY_ALL, MAP_TRIGGER_ALL
|
||||
);
|
||||
cutsceneitemdata_t data;
|
||||
cutsceneMapAreaAddStart(&addItem, &data);
|
||||
uint8_t id = CUTSCENE_SYSTEM.areaLastCreated;
|
||||
|
||||
cutsceneitem_t waitItem = CUTSCENE_MAP_AREA_WAIT(CUTSCENE_AREA_LAST_CREATED);
|
||||
cutsceneMapAreaWaitStart(&waitItem, &data);
|
||||
assert_false(cutsceneMapAreaWaitUpdate(&waitItem, &data));
|
||||
|
||||
MAP_AREAS[id].triggerCount++;
|
||||
assert_true(cutsceneMapAreaWaitUpdate(&waitItem, &data));
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
const struct CMUnitTest tests[] = {
|
||||
cmocka_unit_test(test_cutsceneMapAreaAddCreatesAreaAndStoresLastCreated),
|
||||
cmocka_unit_test(test_cutsceneMapAreaRemoveClearsSlot),
|
||||
cmocka_unit_test(test_cutsceneMapAreaRemoveResolvesLastCreatedSentinel),
|
||||
cmocka_unit_test(test_cutsceneMapAreaWaitCompletesWhenTriggerCountChanges),
|
||||
cmocka_unit_test(test_cutsceneMapAreaWaitCompletesWhenAnyWatchedAreaChanges),
|
||||
cmocka_unit_test(test_cutsceneMapAreaWaitResolvesLastCreatedSentinel),
|
||||
};
|
||||
|
||||
return cmocka_run_group_tests(tests, NULL, NULL);
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "dusktest.h"
|
||||
#include "rpg/cutscene/cutscenesystem.h"
|
||||
#include "rpg/entity/entity.h"
|
||||
#include "time/time.h"
|
||||
|
||||
static uint8_t callbackFired;
|
||||
|
||||
static void recordCallback(void *userData) {
|
||||
callbackFired++;
|
||||
}
|
||||
|
||||
// INNER is jumped into by OUTER's second item, never returning -- this is
|
||||
// the "nested cutscene is a one-way jump" behavior: cutsceneCutsceneStart
|
||||
// replaces CUTSCENE_SYSTEM.scene outright, and the callback item's effect
|
||||
// fires in Start, not Update, so it fires the same frame the jump happens.
|
||||
CUTSCENE(TEST_INNER, 0, NONE,
|
||||
CUTSCENE_CALLBACK(recordCallback)
|
||||
);
|
||||
|
||||
CUTSCENE(TEST_OUTER, 0, DEFAULT,
|
||||
CUTSCENE_WAIT(0.5f),
|
||||
CUTSCENE_CUTSCENE(TEST_INNER)
|
||||
);
|
||||
|
||||
static void test_cutsceneSystemStartSetsUpInitialItem(void **state) {
|
||||
|
||||
cutsceneSystemInit();
|
||||
|
||||
cutsceneSystemStartCutscene(&CUTSCENE_TEST_OUTER);
|
||||
assert_ptr_equal(CUTSCENE_SYSTEM.scene, &CUTSCENE_TEST_OUTER);
|
||||
assert_int_equal(CUTSCENE_SYSTEM.currentItem, 0);
|
||||
assert_int_equal(CUTSCENE_SYSTEM.pause, CUTSCENE_PAUSE_DEFAULT);
|
||||
}
|
||||
|
||||
static void test_cutsceneSystemNestedCutsceneIsOneWayJump(void **state) {
|
||||
|
||||
cutsceneSystemInit();
|
||||
callbackFired = 0;
|
||||
cutsceneSystemStartCutscene(&CUTSCENE_TEST_OUTER);
|
||||
|
||||
TIME.delta = 0.1f;
|
||||
cutsceneSystemUpdate();// wait not elapsed yet
|
||||
assert_ptr_equal(CUTSCENE_SYSTEM.scene, &CUTSCENE_TEST_OUTER);
|
||||
assert_int_equal(callbackFired, 0);
|
||||
|
||||
// The wait elapses, advancing to the nested-cutscene item, which jumps
|
||||
// straight into INNER and starts its first item (the callback) -- all
|
||||
// within this single update call.
|
||||
TIME.delta = 1.0f;
|
||||
cutsceneSystemUpdate();
|
||||
assert_ptr_equal(CUTSCENE_SYSTEM.scene, &CUTSCENE_TEST_INNER);
|
||||
assert_int_equal(CUTSCENE_SYSTEM.currentItem, 0);
|
||||
assert_int_equal(callbackFired, 1);
|
||||
|
||||
// INNER's only item (the callback) always reports complete -- one more
|
||||
// update ends the whole cutscene.
|
||||
cutsceneSystemUpdate();
|
||||
assert_null(CUTSCENE_SYSTEM.scene);
|
||||
assert_int_equal(CUTSCENE_SYSTEM.currentItem, 0xFF);
|
||||
assert_int_equal(CUTSCENE_SYSTEM.pause, CUTSCENE_PAUSE_NONE);
|
||||
}
|
||||
|
||||
static void test_cutsceneSystemUpdateIsNoopWithNoActiveCutscene(void **state) {
|
||||
|
||||
cutsceneSystemInit();
|
||||
|
||||
cutsceneSystemUpdate();// should not crash
|
||||
assert_null(CUTSCENE_SYSTEM.scene);
|
||||
}
|
||||
|
||||
CUTSCENE(TEST_SINGLE_WAIT, 0, NONE,
|
||||
CUTSCENE_WAIT(1.0f)
|
||||
);
|
||||
|
||||
static void test_cutsceneSystemStartWithSetsInteractEntities(void **state) {
|
||||
|
||||
cutsceneSystemInit();
|
||||
entityInit(&ENTITIES[0], ENTITY_TYPE_PLAYER);
|
||||
entityInit(&ENTITIES[1], ENTITY_TYPE_NPC);
|
||||
|
||||
cutsceneSystemStartCutsceneWith(
|
||||
&CUTSCENE_TEST_SINGLE_WAIT, &ENTITIES[0], &ENTITIES[1]
|
||||
);
|
||||
|
||||
assert_ptr_equal(CUTSCENE_SYSTEM.entityInteract, &ENTITIES[0]);
|
||||
assert_ptr_equal(CUTSCENE_SYSTEM.entityInteracted, &ENTITIES[1]);
|
||||
assert_ptr_equal(
|
||||
cutsceneSystemGetEntity(CUTSCENE_ENTITY_INTERACT), &ENTITIES[0]
|
||||
);
|
||||
assert_ptr_equal(
|
||||
cutsceneSystemGetEntity(CUTSCENE_ENTITY_INTERACTED), &ENTITIES[1]
|
||||
);
|
||||
|
||||
TIME.delta = 2.0f;
|
||||
cutsceneSystemUpdate();// ends the cutscene
|
||||
assert_null(CUTSCENE_SYSTEM.entityInteract);// reset on end
|
||||
assert_null(CUTSCENE_SYSTEM.entityInteracted);
|
||||
}
|
||||
|
||||
static void test_cutsceneSystemGetEntitySentinelsRequireBeingSet(
|
||||
void **state
|
||||
) {
|
||||
|
||||
cutsceneSystemInit();
|
||||
|
||||
expect_assert_failure(cutsceneSystemGetEntity(CUTSCENE_ENTITY_INTERACT));
|
||||
expect_assert_failure(cutsceneSystemGetEntity(CUTSCENE_ENTITY_INTERACTED));
|
||||
expect_assert_failure(cutsceneSystemGetEntity(CUTSCENE_ENTITY_LAST_CREATED));
|
||||
expect_assert_failure(cutsceneSystemGetEntity(CUTSCENE_ENTITY_LAST_REF));
|
||||
}
|
||||
|
||||
static void test_cutsceneSystemGetEntityDirectIndexUpdatesLastRef(
|
||||
void **state
|
||||
) {
|
||||
|
||||
cutsceneSystemInit();
|
||||
entityInit(&ENTITIES[2], ENTITY_TYPE_NPC);
|
||||
|
||||
entity_t *resolved = cutsceneSystemGetEntity(2);
|
||||
assert_ptr_equal(resolved, &ENTITIES[2]);
|
||||
// Resolving by direct index also updates LAST_REF.
|
||||
assert_ptr_equal(cutsceneSystemGetEntity(CUTSCENE_ENTITY_LAST_REF), &ENTITIES[2]);
|
||||
}
|
||||
|
||||
static void test_cutsceneSystemGetAreaId(void **state) {
|
||||
|
||||
cutsceneSystemInit();
|
||||
// cutsceneSystemInit() zero-inits the field -- only actually starting a
|
||||
// cutscene sets it to the "nothing created yet" sentinel.
|
||||
CUTSCENE_SYSTEM.areaLastCreated = CUTSCENE_AREA_LAST_CREATED;
|
||||
|
||||
expect_assert_failure(cutsceneSystemGetAreaId(CUTSCENE_AREA_LAST_CREATED));
|
||||
assert_int_equal(cutsceneSystemGetAreaId(5), 5);// direct IDs pass through
|
||||
|
||||
CUTSCENE_SYSTEM.areaLastCreated = 3;
|
||||
assert_int_equal(cutsceneSystemGetAreaId(CUTSCENE_AREA_LAST_CREATED), 3);
|
||||
}
|
||||
|
||||
static void test_cutsceneSystemGetTextMiniId(void **state) {
|
||||
|
||||
cutsceneSystemInit();
|
||||
CUTSCENE_SYSTEM.textMiniLastCreated = CUTSCENE_TEXT_MINI_LAST_CREATED;
|
||||
|
||||
expect_assert_failure(
|
||||
cutsceneSystemGetTextMiniId(CUTSCENE_TEXT_MINI_LAST_CREATED)
|
||||
);
|
||||
assert_int_equal(cutsceneSystemGetTextMiniId(4), 4);
|
||||
|
||||
CUTSCENE_SYSTEM.textMiniLastCreated = 1;
|
||||
assert_int_equal(
|
||||
cutsceneSystemGetTextMiniId(CUTSCENE_TEXT_MINI_LAST_CREATED), 1
|
||||
);
|
||||
}
|
||||
|
||||
static void test_cutsceneSystemDisposeResetsState(void **state) {
|
||||
|
||||
cutsceneSystemInit();
|
||||
entityInit(&ENTITIES[0], ENTITY_TYPE_PLAYER);
|
||||
cutsceneSystemStartCutsceneWith(
|
||||
&CUTSCENE_TEST_SINGLE_WAIT, &ENTITIES[0], &ENTITIES[0]
|
||||
);
|
||||
|
||||
cutsceneSystemDispose();
|
||||
assert_null(CUTSCENE_SYSTEM.scene);
|
||||
assert_int_equal(CUTSCENE_SYSTEM.currentItem, 0xFF);
|
||||
assert_int_equal(CUTSCENE_SYSTEM.pause, CUTSCENE_PAUSE_NONE);
|
||||
assert_null(CUTSCENE_SYSTEM.entityInteract);
|
||||
assert_null(CUTSCENE_SYSTEM.entityInteracted);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
const struct CMUnitTest tests[] = {
|
||||
cmocka_unit_test(test_cutsceneSystemStartSetsUpInitialItem),
|
||||
cmocka_unit_test(test_cutsceneSystemNestedCutsceneIsOneWayJump),
|
||||
cmocka_unit_test(test_cutsceneSystemUpdateIsNoopWithNoActiveCutscene),
|
||||
cmocka_unit_test(test_cutsceneSystemStartWithSetsInteractEntities),
|
||||
cmocka_unit_test(test_cutsceneSystemGetEntitySentinelsRequireBeingSet),
|
||||
cmocka_unit_test(test_cutsceneSystemGetEntityDirectIndexUpdatesLastRef),
|
||||
cmocka_unit_test(test_cutsceneSystemGetAreaId),
|
||||
cmocka_unit_test(test_cutsceneSystemGetTextMiniId),
|
||||
cmocka_unit_test(test_cutsceneSystemDisposeResetsState),
|
||||
};
|
||||
|
||||
return cmocka_run_group_tests(tests, NULL, NULL);
|
||||
}
|
||||
Reference in New Issue
Block a user