added glshim library

This commit is contained in:
lubomyr
2015-02-09 20:25:03 +00:00
parent e5e9109652
commit 967c18296e
143 changed files with 231962 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
#include "gl_str.h"
int main() {
#define check(func, name) assert(strcmp(func(name), #name) == 0);
check(gl_str_primitive, GL_QUADS);
check(gl_str, GL_FLOAT);
check(gl_bits_glPushClientAttrib, GL_CLIENT_ALL_ATTRIB_BITS);
check(gl_bits_glPushAttrib, GL_CURRENT_BIT | GL_POINT_BIT);
mock_return;
}

View File

@@ -0,0 +1,30 @@
int main() {
tack_t stack = {0};
tack_push(&stack, 1);
assert(tack_peek(&stack) == 1);
assert(tack_len(&stack) == 1);
tack_push(&stack, 2);
tack_push(&stack, 3);
assert(tack_get(&stack, 0) == 1);
assert(tack_peek(&stack) == 3);
assert(tack_pop(&stack) == 3);
assert(tack_peek(&stack) == 2);
tack_clear(&stack);
assert(tack_len(&stack) == 0);
for (int i = 0; i < 10000; i++) {
tack_push(&stack, i);
assert(tack_peek(&stack) == i);
}
for (int i = 0; i < 10000; i++) {
assert(tack_shift(&stack) == i);
}
tack_clear(&stack);
tack_set(&stack, 1, "test");
assert(tack_get(&stack, 0) == NULL);
assert(strcmp(tack_get(&stack, 1), "test") == 0);
mock_return;
}