libcdsb/tests/src/global/main.c

35 lines
954 B
C
Raw Normal View History

2022-08-16 18:38:35 +03:00
/* This software is licensed by the MIT License, see LICENSE file */
/* Copyright © 2022 Gregory Lirent */
#include "plug.h"
int main(int argc, char** argv) {
test_init(argc, argv);
value_t x = random_container(0);
switch (x.type) {
default: abort();
case VTYPE_ARRAY:
array_info((void*)x.value, 0);
array_free((void*)x.value);
return 0;
case VTYPE_MAP:
map_info((void*)x.value, 0);
map_free((void*)x.value);
return 0;
case VTYPE_LIST:
list_info((void*)x.value, 0);
list_free((void*)x.value);
return 0;
case VTYPE_SET:
vset_info((void*)x.value, 0);
vset_free((void*)x.value);
return 0;
case VTYPE_DICT:
dict_info((void*)x.value, 0);
dict_free((void*)x.value);
return 0;
}
}