wip
This commit is contained in:
@ -239,8 +239,8 @@ void test_vector() {
|
||||
t = (int*)vec_at(v, 4);
|
||||
assert(*t == e4);
|
||||
|
||||
const int *min = vec_min(v, vec_cmp_int);
|
||||
const int *max = vec_max(v, vec_cmp_int);
|
||||
const int *min = vec_min(v, compar_int);
|
||||
const int *max = vec_max(v, compar_int);
|
||||
printf("min: %d\n", *min);
|
||||
printf("max: %d\n", *max);
|
||||
assert(*min == e0);
|
||||
@ -260,6 +260,19 @@ void test_vector() {
|
||||
assert(vec_len(v) == vec_cap(v));
|
||||
printf("cap after shrink: %zu\n", vec_cap(v));
|
||||
|
||||
int s1 = 10;
|
||||
int s2 = 2;
|
||||
int s3 = 1;
|
||||
vec_push(v, &s1);
|
||||
vec_push(v, &s2);
|
||||
vec_push(v, &s3);
|
||||
|
||||
printf("Before sort: ");
|
||||
print_vector(v);
|
||||
vec_sort(v, compar_int);
|
||||
printf("After sort: ");
|
||||
print_vector(v);
|
||||
|
||||
vec_destroy(v);
|
||||
free(v);
|
||||
}
|
||||
|
Reference in New Issue
Block a user