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"
24#include "serene/rt/strings.h"
25
26#define CTX_TESTS(X) X("context::make", test_context_make)
27
28static 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}
#define TEST_CHECK(cond)
Definition acutest.h:95
#define RELEASE_CONTEXT(x)
Definition base.h:48
#define ASSERT_NOT_NULL(x)
Definition base.h:30
#define SHUTDOWN_ENGINE(mm, engine)
Definition base.h:40
#define MAKE_ENGINE(mm, engine)
Definition base.h:34
#define MAKE_CONTEXT(engine, x)
Definition base.h:44
static void test_context_make()
A namespace is an isolation for names nad technically a compilation unit.