wip
All checks were successful
Test and Deploy / test (push) Successful in 12s
Test and Deploy / docs (push) Has been skipped

This commit is contained in:
2024-05-06 12:17:13 -07:00
parent a99d1d3784
commit 04e4d07e99
8 changed files with 58 additions and 48 deletions

View File

@ -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);
}