Collect all of the various spread out 3rd party licenses to a single file.
[SquirrelJME.git] / nanocoat / tests / testAllocPoolCleanup.c
blob37561b966930c8d4adbae266665279b14e7f54ed
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 "proto.h"
11 #include "sjme/alloc.h"
12 #include "test.h"
13 #include "unit.h"
15 /**
16 * Tests cleanup of the allocation pool.
18 * @since 2023/11/29
20 SJME_TEST_DECLARE(testAllocPoolCleanup)
22 void* chunk;
23 sjme_jint chunkLen;
24 uint8_t* block;
25 sjme_alloc_pool* pool;
26 sjme_alloc_link* link;
28 /* Allocate data on the stack so it gets cleared. */
29 chunkLen = 32768;
30 chunk = sjme_alloca(chunkLen);
31 if (chunk == NULL)
32 return sjme_unit_skip(test, "Could not alloca(%d).",
33 (int)chunkLen);
35 /* Initialize the pool. */
36 pool = NULL;
37 if (sjme_error_is(sjme_alloc_poolInitStatic(&pool,
38 chunk, chunkLen)) || pool == NULL)
39 return sjme_unit_fail(test, "Could not initialize static pool?");
41 sjme_todo("Implement %s", __func__);
42 return SJME_TEST_RESULT_FAIL;