refactor(build): add static_library

This commit is contained in:
2025-09-12 01:43:26 +02:00
parent 25e259ae07
commit 56fa31d087
13 changed files with 349 additions and 152 deletions

23
test/stack/stack1.c Normal file
View File

@@ -0,0 +1,23 @@
#include <assert.h>
#include <stdlib.h>
#include "../../stack/mystack.h"
void test_stack1(void) {
stack_s *stack = stack_new(32, sizeof(int));
int num = 10;
stack_push(stack, &num);
num = 13;
stack_push(stack, &num);
int *rv = (int *)stack_top(stack);
assert(*rv == 13);
free(rv);
rv = (int *)stack_pop(stack);
assert(*rv == 13);
free(rv);
stack_free(stack);