1 /* Copyright (c) 2013-2016 Jeffrey Pfau 2 * 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 #include "util/test/suite.h" 7 8 #include <mgba/core/core.h> 9 #include <mgba-util/vfs.h> 10 11 #if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 M_TEST_DEFINE(findNullPath)12M_TEST_DEFINE(findNullPath) { 13 struct mCore* core = mCoreFind(NULL); 14 assert_null(core); 15 } 16 #endif 17 M_TEST_DEFINE(findNullVF)18M_TEST_DEFINE(findNullVF) { 19 struct mCore* core = mCoreFindVF(NULL); 20 assert_null(core); 21 } 22 M_TEST_DEFINE(findEmpty)23M_TEST_DEFINE(findEmpty) { 24 struct VFile* vf = VFileMemChunk(NULL, 0); 25 assert_non_null(vf); 26 struct mCore* core = mCoreFindVF(vf); 27 assert_null(core); 28 vf->close(vf); 29 } 30 31 M_TEST_SUITE_DEFINE(mCore, 32 #if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 33 cmocka_unit_test(findNullPath), 34 #endif 35 cmocka_unit_test(findNullVF), 36 cmocka_unit_test(findEmpty)) 37