Update tests for new check library & osx

This commit is contained in:
Nils O. Selåsdal
2025-06-28 00:56:58 +02:00
parent 9d2ed015f3
commit fb8979d695
29 changed files with 449 additions and 27 deletions
+14
View File
@@ -4,6 +4,7 @@
START_TEST (test_new_gbuf)
{
GBuf *buf = uc_new_gbuf(11);
fail_if(buf == NULL);
@@ -13,9 +14,11 @@ START_TEST (test_new_gbuf)
fail_if(buf->used != 0);
uc_gbuf_unref(buf);
}
END_TEST
START_TEST (test_gbuf_grow)
{
GBuf *buf = uc_new_gbuf(33);
int rc;
@@ -29,9 +32,11 @@ START_TEST (test_gbuf_grow)
fail_if(buf->used != 0);
uc_gbuf_unref(buf);
}
END_TEST
START_TEST (test_gbuf_append1)
{
const char *data = "lorum_ ipson 1234567890";
int rc;
GBuf *buf = uc_new_gbuf(11);
@@ -44,9 +49,11 @@ START_TEST (test_gbuf_append1)
fail_if(strcmp(data, buf->buf) != 0);
uc_gbuf_unref(buf);
}
END_TEST
START_TEST (test_gbuf_printf1)
{
int rc;
GBuf *buf = uc_new_gbuf(10);
@@ -58,9 +65,11 @@ START_TEST (test_gbuf_printf1)
fail_if(strcmp("test 1", buf->buf) != 0);
uc_gbuf_unref(buf);
}
END_TEST
START_TEST (test_gbuf_printf2)
{
int rc;
GBuf *buf = uc_new_gbuf(8);
@@ -72,9 +81,11 @@ START_TEST (test_gbuf_printf2)
fail_if(strcmp("test 1 test 2 test 3", buf->buf) != 0);
uc_gbuf_unref(buf);
}
END_TEST
START_TEST (test_gbuf_printf3)
{
int rc;
GBuf *buf = uc_new_gbuf(8);
@@ -92,9 +103,11 @@ START_TEST (test_gbuf_printf3)
fail_if(strcmp("test 1 test 2 test 3 test 4 test 5", buf->buf) != 0);
uc_gbuf_unref(buf);
}
END_TEST
START_TEST (test_gbuf_printf_empty_string)
{
int rc;
GBuf *buf = uc_new_gbuf(1);
const char *fmt = ""; //tricks gcc to not warn about empty format string
@@ -106,6 +119,7 @@ START_TEST (test_gbuf_printf_empty_string)
fail_if(buf->used != 0);
uc_gbuf_unref(buf);
}
END_TEST