1 /* -*- Mode: C; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
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"
17 * Basic initialization and destroy of string pool.
21 SJME_TEST_DECLARE(testStringPool
)
23 sjme_stringPool stringPool
;
25 /* Create string pool. */
27 if (sjme_error_is(test
->error
= sjme_stringPool_new(
28 test
->pool
, &stringPool
)) ||
30 return sjme_unit_fail(test
, "Could not create pool.");
32 /* These should be properly set. */
33 sjme_unit_notEqualP(test
, NULL
, stringPool
->strings
,
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.");
44 return SJME_TEST_RESULT_PASS
;