Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chris Müller
cherry
Commits
3ad01f40
Commit
3ad01f40
authored
Jul 08, 2013
by
Chris Müller
Browse files
add prototype for runtime unittests
parent
4ec237e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
test/CMakeLists.txt
View file @
3ad01f40
...
...
@@ -5,5 +5,5 @@ set(TEST_SOURCES
add_executable
(
cherry-testsuite
${
TEST_SOURCES
}
)
target_link_libraries
(
cherry-testsuite crystal cherry-core
)
target_link_libraries
(
cherry-testsuite crystal
gc
cherry-core
)
test/main.c
View file @
3ad01f40
...
...
@@ -17,15 +17,19 @@
*/
#include
<crystal/unittest.h>
#include
<cherry/runtime.h>
void
test_suite_lex
();
int
main
(
int
argc
,
char
**
argv
)
{
org_cherry_initialize
(
0
);
cry_unittest_initialize
(
argc
,
argv
);
test_suite_lex
();
test_suite_runtime
();
cry_unittest_finalize
();
...
...
test/runtime.c
View file @
3ad01f40
...
...
@@ -21,7 +21,15 @@
static
void
test_symbollist
(
const_pointer
data
)
{
struct
org_cherry_symbollist
*
sym
=
org_cherry_symbollist
();
struct
org_cherry_Value
*
A
=
org_cherry_symbollist_get
(
sym
,
"A"
);
struct
org_cherry_Value
*
B
=
org_cherry_symbollist_get
(
sym
,
"B"
);
struct
org_cherry_Value
*
C
=
org_cherry_symbollist_get
(
sym
,
"A"
);
assert
(
A
!=
B
);
assert
(
A
==
C
);
assert
(
B
!=
C
);
}
void
test_suite_runtime
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment