Correct compilation error for the ScritchUI bridge.
[SquirrelJME.git] / nanocoat / tests / testStringPool.c
blob03c0bbcd7cabbea4f6ef8c715b4898d7d052bfa9
1 /* -*- Mode: C; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // -------------------------------------------------------------------------*/
10 #include "sjme/nvm/stringPool.h"
11 #include "test.h"
12 #include "proto.h"
13 #include "mock.h"
14 #include "unit.h"
16 /**
17 * Basic initialization and destroy of string pool.
19 * @since 2024/09/14
21 SJME_TEST_DECLARE(testStringPool)
23 sjme_stringPool stringPool;
25 /* Create string pool. */
26 stringPool = NULL;
27 if (sjme_error_is(test->error = sjme_stringPool_new(
28 test->pool, &stringPool)) ||
29 stringPool == NULL)
30 return sjme_unit_fail(test, "Could not create pool.");
32 /* These should be properly set. */
33 sjme_unit_notEqualP(test, NULL, stringPool->strings,
34 "Strings not set?");
35 sjme_unit_greaterEqualI(test, 1, stringPool->strings->length,
36 "Initial strings length zero or negative?");
38 /* Close string pool. */
39 if (sjme_error_is(test->error = sjme_closeable_close(
40 SJME_AS_CLOSEABLE(stringPool))))
41 return sjme_unit_fail(test, "Could not close pool.");
43 /* Pass! */
44 return SJME_TEST_RESULT_PASS;