Serene Runtime
1.0.0-dev
C runtime for the Serene programming language
Loading...
Searching...
No Matches
context_tests.h
Go to the documentation of this file.
1
/* -*- C -*-
2
* Serene programming language
3
* Copyright (C) 2019-2026 Sameer Rahmani <lxsameer@lxsameer.com>
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17
*/
18
19
#pragma once
20
21
#include "
base.h
"
22
#include "
serene/rt/core.h
"
23
#include "
serene/rt/namespaces.h
"
24
#include "
serene/rt/strings.h
"
25
26
#define CTX_TESTS(X) X("context::make", test_context_make)
27
28
static
void
test_context_make
() {
29
MAKE_ENGINE
(mm, engine);
30
MAKE_CONTEXT
(engine, ctx);
31
ASSERT_NOT_NULL
(ctx);
32
ASSERT_NOT_NULL
(ctx->engine);
33
TEST_CHECK
(ctx->parent ==
nullptr
);
34
RELEASE_CONTEXT
(ctx);
35
SHUTDOWN_ENGINE
(mm, engine);
36
}
TEST_CHECK
#define TEST_CHECK(cond)
Definition
acutest.h:95
base.h
RELEASE_CONTEXT
#define RELEASE_CONTEXT(x)
Definition
base.h:48
ASSERT_NOT_NULL
#define ASSERT_NOT_NULL(x)
Definition
base.h:30
SHUTDOWN_ENGINE
#define SHUTDOWN_ENGINE(mm, engine)
Definition
base.h:40
MAKE_ENGINE
#define MAKE_ENGINE(mm, engine)
Definition
base.h:34
MAKE_CONTEXT
#define MAKE_CONTEXT(engine, x)
Definition
base.h:44
test_context_make
static void test_context_make()
Definition
context_tests.h:28
core.h
namespaces.h
A namespace is an isolation for names nad technically a compilation unit.
strings.h
tests
runtime
context_tests.h
Serene Runtime is free software, licensed under the
GNU LGPL v3
License.