diff --git a/test/graphemetest.c b/test/graphemetest.c index bc55b16..25c7ddb 100644 --- a/test/graphemetest.c +++ b/test/graphemetest.c @@ -1,10 +1,8 @@ #include "tests.h" -#include "simple_getline.h" int main(int argc, char **argv) { char buf[8192]; - size_t bufsize = 0; FILE *f = argc > 1 ? fopen(argv[1], "r") : NULL; utf8proc_uint8_t src[1024]; int len; diff --git a/test/normtest.c b/test/normtest.c index 34921bf..40e3112 100644 --- a/test/normtest.c +++ b/test/normtest.c @@ -1,5 +1,4 @@ #include "tests.h" -#include "simple_getline.h" #define CHECK_NORM(NRM, norm, src) { \ char *src_norm = (char*) utf8proc_ ## NRM((utf8proc_uint8_t*) src); \ diff --git a/test/simple_getline.h b/test/simple_getline.h deleted file mode 100644 index 453cff6..0000000 --- a/test/simple_getline.h +++ /dev/null @@ -1,11 +0,0 @@ -/* simplistic, portable replacement for getline, sufficient for our tests */ -static size_t simple_getline(char buf[8192], FILE *f) { - size_t i = 0; - while (i < 1023) { - int c = getc(f); - if (c == EOF || c == '\n') break; - buf[i++] = (char) c; - } - buf[i] = 0; - return i; -} diff --git a/test/tests.c b/test/tests.c index 0fb0da3..8cc3119 100644 --- a/test/tests.c +++ b/test/tests.c @@ -44,3 +44,15 @@ size_t encode(char *dest, const char *buf) d += utf8proc_encode_char(c, (utf8proc_uint8_t *) (dest + d)); } } + +/* simplistic, portable replacement for getline, sufficient for our tests */ +size_t simple_getline(char buf[8192], FILE *f) { + size_t i = 0; + while (i < 1023) { + int c = getc(f); + if (c == EOF || c == '\n') break; + buf[i++] = (char) c; + } + buf[i] = 0; + return i; +} diff --git a/test/tests.h b/test/tests.h index 1811a73..8447e86 100644 --- a/test/tests.h +++ b/test/tests.h @@ -21,3 +21,4 @@ extern size_t lineno; void check(int cond, const char *format, ...); size_t skipspaces(const char *buf, size_t i); size_t encode(char *dest, const char *buf); +size_t simple_getline(char buf[8192], FILE *f);