Update tests headers

This commit is contained in:
Gregory Lirent 2022-08-16 18:36:50 +03:00
parent 3930412674
commit 4056544d49
4 changed files with 13 additions and 83 deletions

View File

@ -9,7 +9,6 @@
#include "../../include/test.h"
#include "../../include/time.h"
extern void array_print(arr_t* x, const char* prefix, unsigned int hpos);
extern void array_info(arr_t* x, unsigned int hpos);
@ -23,71 +22,3 @@ extern void visual_slice(arr_t* x, arr_t* s);
extern void array_push_random (arr_t* x, _Bool silent, unsigned int hpos);
extern void array_remove_random(arr_t* x, _Bool silent, unsigned int hpos);
/*
static void array_push_random(vtype_array* x) {
switch (random_uint8()%13) {
default:
case 0: array_push(x, random_boolean()); break;
case 1: array_push(x, random_uint8()); break;
case 2: array_push(x, random_uint16()); break;
case 3: array_push(x, random_uint32()); break;
case 4: array_push(x, random_uint64()); break;
case 5: array_push(x, random_int8()); break;
case 6: array_push(x, random_int16()); break;
case 7: array_push(x, random_int32()); break;
case 8: array_push(x, random_int64()); break;
case 9: array_push(x, (void*)((sizeof(void*) == 8) ? random_uint64() : random_uint32())); break;
case 10: array_push(x, random_float()); break;
case 11: array_push(x, random_double()); break;
case 12: array_push(x, random_ldouble()); break;
}
}
static void array_init_random(vtype_array* x) {
switch (random_uint8()%13) {
default:
case 0: array_init(x, VTYPE_BOOLEAN); break;
case 1: array_init(x, VTYPE_UINT8); break;
case 2: array_init(x, VTYPE_UINT16); break;
case 3: array_init(x, VTYPE_UINT32); break;
case 4: array_init(x, VTYPE_UINT64); break;
case 5: array_init(x, VTYPE_INT8); break;
case 6: array_init(x, VTYPE_INT16); break;
case 7: array_init(x, VTYPE_INT32); break;
case 8: array_init(x, VTYPE_INT64); break;
case 9: array_init(x, VTYPE_POINTER); break;
case 10: array_init(x, VTYPE_FLOAT); break;
case 11: array_init(x, VTYPE_DOUBLE); break;
case 12: array_init(x, VTYPE_LDOUBLE); break;
}
}
static vtype_array array_random(unsigned int n) {
vtype_array x;
array_init_random(&x);
for (int i = 0; i < n; ++i) {
array_push_random(&x);
}
return x;
}
static int array_value_print(void* v, ssize_t i, vtype t, void* _) {
print_container_value(&i, v, t, false);
return 0;
}
static void array_print(vtype_array* x, const char* prefix) {
print_container_values_prefix("Array", prefix);
array_foreach(x, 0, array_value_print);
put_separator();
}
static void array_info(const vtype_array* x) {
print_container_info("Array", 0, &x->type, array_size(x), array_nmemb(x));
put_separator();
}
*/

View File

@ -7,11 +7,11 @@
#include "../../include/test.h"
#include "../../include/time.h"
void dict_push_random(dict_t* x, bool silent, unsigned int hpos);
void dict_remove_random(dict_t* x, bool silent, unsigned int hpos);
extern void dict_push_random(dict_t* x, bool silent, unsigned int hpos);
extern void dict_remove_random(dict_t* x, bool silent, unsigned int hpos);
void dict_print(dict_t* x, const char* prefix, unsigned int hpos);
void dict_info(const dict_t* x, unsigned int hpos);
extern void dict_info(const dict_t* x, unsigned int hpos);
extern void dict_print(dict_t* x, const char* prefix, unsigned int hpos);
void visual_push(dict_t* x, size_t n);
void visual_remove(dict_t* x);
extern void visual_push(dict_t* x, size_t n);
extern void visual_remove(dict_t* x);

View File

@ -17,7 +17,6 @@ void list_info(list_t* x, unsigned int hpos) {
print_container_info("List", "nodes", 0, list_size(x), -1, hpos);
}
void visual_push(list_t* x, size_t n) {
for (int i = 0; i < n; ++i) {
fputs("\e[s", stdout);

View File

@ -7,12 +7,12 @@
#include "../../include/test.h"
#include "../../include/time.h"
void map_push_random(map_t* x, _Bool silent, unsigned int hpos);
void map_remove_random(map_t* x, _Bool silent, unsigned int hpos);
extern void map_push_random(map_t* x, _Bool silent, unsigned int hpos);
extern void map_remove_random(map_t* x, _Bool silent, unsigned int hpos);
void map_print(map_t* x, const char* prefix, unsigned int hpos);
void map_info(const map_t* x, unsigned int hpos);
void map_rbtree_print(map_t *x, const char* prefix, unsigned int hpos);
extern void map_info(const map_t* x, unsigned int hpos);
extern void map_print(map_t* x, const char* prefix, unsigned int hpos);
extern void map_rbtree_print(map_t *x, const char* prefix, unsigned int hpos);
void visual_push(map_t* x, size_t n);
void visual_remove(map_t* x);
extern void visual_push(map_t* x, size_t n);
extern void visual_remove(map_t* x);