language

Some fools attempt at an interpreted language
Log | Files | Refs

test.c (504B)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>

#include "var.h"
#include "helper.h"

int main( void )
{
	var_cont* test0 = var_new(VOID);
	if (test0->type == VOID)
		printf("1\n");
	else
		printf("0\n");

	var_cont* test1 = var_new(G_INT);

	var_set(test1, var_data_alloc_G_INT(32), G_INT);
	if (*(test1->data) == 32)
		printf("1\n");
	else
		printf("0: %d\n", *(test1->data));

	printf("%i -> ", test1->type);
	var_cast(test1, G_FLOAT);
	printf("%i\n", test1->type);

	N_ASSERT(test1->data);
	
	var_del(test0);
	var_del(test1);
}