$(o)/lib/ipaccess-test: $(o)/lib/ipaccess-test.o $(LIBUCW)
TESTS+=$(addprefix $(o)/lib/,regex.test unicode-utf8.test hash-test.test mempool.test stkstring.test \
- slists.test kmp-test.test bbuf.test getopt.test fb-pool.test)
+ slists.test kmp-test.test bbuf.test getopt.test fastbuf.test)
$(o)/lib/regex.test: $(o)/lib/regex-t
$(o)/lib/unicode-utf8.test: $(o)/lib/unicode-utf8-t
$(o)/lib/kmp-test.test: $(o)/lib/kmp-test
$(o)/lib/bbuf.test: $(o)/lib/bbuf-t
$(o)/lib/getopt.test: $(o)/lib/getopt-t
-$(o)/lib/fb-pool.test: $(o)/lib/fb-pool-t
+$(o)/lib/fastbuf.test: $(o)/lib/fb-grow-t $(o)/lib/fb-pool-t
ifdef CONFIG_UCW_THREADS
TESTS+=$(addprefix $(o)/lib/,asio.test)
--- /dev/null
+# Tests for fastbufs
+
+Run: obj/lib/fb-grow-t
+Out: <10><10><0>1234512345<10><9>5<10>
+ <30><30><0>1234512345<10><9>5<10>
+ <20><20><0>1234512345<10><9>5<10>
+ <20><20><0>1234512345<10><9>5<10>
+ <20><20><0>1234512345<10><9>5<10>
+
+Run: obj/lib/fb-pool-t
int main(void)
{
struct fastbuf *f;
- int t;
+ uns t;
f = fbgrow_create(3);
for (uns i=0; i<5; i++)
{
- fbgrow_write(f);
bwrite(f, "12345", 5);
bwrite(f, "12345", 5);
printf("<%d>", (int)btell(f));
printf("<%d>", (int)btell(f));
fbgrow_rewind(f);
printf("<%d>", (int)btell(f));
- while ((t = bgetc(f)) >= 0)
+ while ((t = bgetc(f)) != ~0U)
putchar(t);
printf("<%d>", (int)btell(f));
fbgrow_rewind(f);
bseek(f, -1, SEEK_END);
printf("<%d>", (int)btell(f));
- while ((t = bgetc(f)) >= 0)
+ while ((t = bgetc(f)) != ~0U)
putchar(t);
printf("<%d>\n", (int)btell(f));
}
+++ /dev/null
-# Tests for fastbufs on memory pools
-
-Run: obj/lib/fb-pool-t