Better memory management of arrays and test sample generation
This commit is contained in:
15
test/samples.c
Normal file
15
test/samples.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "../include/types.h"
|
||||
#include "include/samples.h"
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
lsort_array* generate_samples(int number) {
|
||||
srand(time(NULL));
|
||||
lsort_array* array = lsort_array_create();
|
||||
|
||||
for (int i = 0; i < number; i++) {
|
||||
lsort_array_append(array, lsort_item_create(rand(), NULL));
|
||||
}
|
||||
|
||||
return array;
|
||||
};
|
||||
Reference in New Issue
Block a user