Serene Runtime 1.0.0
C runtime for the Serene programming language
Loading...
Searching...
No Matches
value_tests.h File Reference
#include <serene/rt/core.h>
#include <serene/rt/core/numbers.h>
#include "base.h"
Include dependency graph for value_tests.h:

Go to the source code of this file.

Macros

#define VALUE_TESTS(X)
 
#define V_TEST_LOG(...)
 

Functions

static void test_value_basics ()
 

Macro Definition Documentation

◆ V_TEST_LOG

#define V_TEST_LOG ( ...)

Definition at line 31 of file value_tests.h.

◆ VALUE_TESTS

#define VALUE_TESTS ( X)
Value:
X("values::basics", test_value_basics),
static void test_value_basics()
Definition value_tests.h:34

Definition at line 26 of file value_tests.h.

Function Documentation

◆ test_value_basics()

static void test_value_basics ( )
static

Definition at line 34 of file value_tests.h.

34 {
35 MAKE_ENGINE(mm, engine);
36 MAKE_CONTEXT(engine, ctx);
37
40
41 TEST_CHECK(x1->type == VI64);
42 TEST_CHECK(x1->as.i64 == 5);
43 TEST_CHECK(x2->as.i64 == -15);
44
45 RELEASE_CONTEXT(ctx);
46 SHUTDOWN_ENGINE(mm, engine);
47}
#define TEST_CHECK(cond)
Definition acutest.h:96
#define RELEASE_CONTEXT(x)
Definition base.h:46
#define SHUTDOWN_ENGINE(mm, engine)
Definition base.h:38
#define MAKE_ENGINE(mm, engine)
Definition base.h:32
#define MAKE_CONTEXT(engine, x)
Definition base.h:42
static srn_metadata_t absurd_metadata
We use this for testing.
Definition core.h:66
@ VI64
Definition core.h:116
static srn_value_t * srn_make_i64(srn_context_t *ctx, srn_metadata_t *metadata, int64_t x)
Definition numbers.h:24
int64_t i64
We represent all the immidiate numbers with this field and cast as we to an appropriate type.
Definition core.h:138
union srn_value_t::@033047061046230251001111174367071167226300135003 as
IMPORTANT NOTE: The size of this union should never be larger than a word.
srn_value_tag_t type
Definition core.h:132
Here is the call graph for this function: