src/platform/test/suite/common/core.c (view raw)
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 "platform/test/suite/suite.h"
7
8#include "core/core.h"
9#include "util/vfs.h"
10
11#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2
12M_TEST_DEFINE(findNullPath) {
13 struct mCore* core = mCoreFind(NULL);
14 assert_null(core);
15}
16#endif
17
18M_TEST_DEFINE(findNullVF) {
19 struct mCore* core = mCoreFindVF(NULL);
20 assert_null(core);
21}
22
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
31M_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))