mirror of
https://github.com/pevans/erc-c.git
synced 2025-01-02 09:29:58 +00:00
Add tests for vm_di
This commit is contained in:
parent
919869289e
commit
69d425db2d
18
tests/vm_di.c
Normal file
18
tests/vm_di.c
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include <criterion/criterion.h>
|
||||||
|
|
||||||
|
#include "vm_di.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The set test is also (informally) the get test, since there's no
|
||||||
|
* independent means to inspect what is in the DI container table.
|
||||||
|
*
|
||||||
|
* Test(vm_di, get)
|
||||||
|
*/
|
||||||
|
Test(vm_di, set)
|
||||||
|
{
|
||||||
|
cr_assert_eq(vm_di_get(VM_MACHINE), NULL);
|
||||||
|
vm_di_set(VM_MACHINE, (void *)123);
|
||||||
|
cr_assert_eq(vm_di_get(VM_MACHINE), (void *)123);
|
||||||
|
vm_di_set(VM_MACHINE, (void *)234);
|
||||||
|
cr_assert_eq(vm_di_get(VM_MACHINE), (void *)234);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user