Collect all of the various spread out 3rd party licenses to a single file.
[SquirrelJME.git] / nanocoat / tests / testExceptFail.c
bloba1ac94ac52fd1612bd9ab580529c08f8a8e16142
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 <string.h>
12 #include "proto.h"
13 #include "sjme/except.h"
14 #include "test.h"
15 #include "unit.h"
17 /**
18 * Tests failing of the exception handler.
20 * @since 2023/11/28
22 SJME_TEST_DECLARE(testExceptFail)
24 SJME_EXCEPT_VDEF;
25 volatile sjme_exceptTrace* trace;
27 /* Setup test. */
28 trace = NULL;
30 /* Fail. */
31 exceptTraceE_sjme = 666;
32 SJME_EXCEPT_WITH(trace):
33 SJME_EXCEPT_TOSS(SJME_ERROR_TOP_NOT_LONG);
35 /* Should hopefully not be reached. */
36 sjme_unit_fail(test, "Should not be reached here?");
38 SJME_EXCEPT_FAIL:
39 sjme_unit_equalI(test, exceptTraceE_sjme, SJME_ERROR_TOP_NOT_LONG,
40 "Error code was not set?");
42 /* Success otherwise. */
43 SJME_EXCEPT_DONE(SJME_TEST_RESULT_PASS);