A blank base for heavier AWT components that would be needed by applets in the future...
[SquirrelJME.git] / nanocoat / tests / testZipOpenClose.c
blob1beee001e898f2d266c7867004fd81f78c1bb2a7
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 "mock.h"
11 #include "proto.h"
12 #include "test.h"
13 #include "unit.h"
14 #include "sjme/zip.h"
15 #include "mock.jar.h"
17 /**
18 * Tests the opening and closing of Zip files.
20 * @since 2023/12/31
22 SJME_TEST_DECLARE(testZipOpenClose)
24 sjme_zip zip;
26 /* Attempt open of Zip. */
27 zip = NULL;
28 if (sjme_error_is(sjme_zip_open(test->pool, &zip,
29 mock_jar__bin, mock_jar__len)) || zip == NULL)
30 return sjme_unit_fail(test, "Could not open Zip");
32 /* Immediately close it without doing anything. */
33 if (sjme_error_is(sjme_zip_close(zip)))
34 return sjme_unit_fail(test, "Could not close Zip");
36 /* Passed! */
37 return SJME_TEST_RESULT_PASS;