diff options
author | David Robillard <d@drobilla.net> | 2018-05-12 20:39:23 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:58 +0100 |
commit | 95f7334bbc02f3e75b33b9914eee58c69f1588bd (patch) | |
tree | bed06e929f286d099181d5e2e76ecf508df0add9 /tests | |
parent | 4f4408029cd8cefc1804d75a03f5c3f0ee7922fa (diff) | |
download | serd-95f7334bbc02f3e75b33b9914eee58c69f1588bd.tar.gz serd-95f7334bbc02f3e75b33b9914eee58c69f1588bd.tar.bz2 serd-95f7334bbc02f3e75b33b9914eee58c69f1588bd.zip |
Use a fixed-size reader stack
This improves performance, and makes the reader more suitable for embedded or
network-facing applications, at the cost of requiring the user to specify a
maximum stack size.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/read_chunk_test.c | 2 | ||||
-rw-r--r-- | tests/serd_test.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/read_chunk_test.c b/tests/read_chunk_test.c index decfe829..9fa40bab 100644 --- a/tests/read_chunk_test.c +++ b/tests/read_chunk_test.c @@ -82,7 +82,7 @@ main(void) SerdWorld* world = serd_world_new(); const SerdSink sink = {NULL, on_base, on_prefix, on_statement, on_end}; - SerdReader* reader = serd_reader_new(world, SERD_TURTLE, &sink); + SerdReader* reader = serd_reader_new(world, SERD_TURTLE, &sink, 4096); assert(reader); assert(!serd_reader_start_string(reader, diff --git a/tests/serd_test.c b/tests/serd_test.c index 72f5db84..859ba088 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -133,7 +133,7 @@ test_read_chunks(void) FILE* const f = tmpfile(); static const char null = 0; SerdSink sink = {rt, NULL, NULL, test_sink, NULL}; - SerdReader* reader = serd_reader_new(world, SERD_TURTLE, &sink); + SerdReader* reader = serd_reader_new(world, SERD_TURTLE, &sink, 4096); assert(reader); assert(f); @@ -213,7 +213,7 @@ test_read_string(void) SerdWorld* world = serd_world_new(); ReaderTest* rt = (ReaderTest*)calloc(1, sizeof(ReaderTest)); SerdSink sink = {rt, NULL, NULL, test_sink, NULL}; - SerdReader* reader = serd_reader_new(world, SERD_TURTLE, &sink); + SerdReader* reader = serd_reader_new(world, SERD_TURTLE, &sink, 4096); assert(reader); // Test reading a string that ends exactly at the end of input (no newline) @@ -360,7 +360,7 @@ test_strerror(void) { const char* msg = serd_strerror(SERD_SUCCESS); assert(!strcmp(msg, "Success")); - for (int i = SERD_FAILURE; i <= SERD_ERR_INTERNAL; ++i) { + for (int i = SERD_FAILURE; i <= SERD_ERR_OVERFLOW; ++i) { msg = serd_strerror((SerdStatus)i); assert(strcmp(msg, "Success")); } @@ -687,7 +687,7 @@ test_reader(const char* path) SerdWorld* world = serd_world_new(); ReaderTest rt = { 0, NULL }; SerdSink sink = { &rt, NULL, NULL, test_sink, NULL }; - SerdReader* reader = serd_reader_new(world, SERD_TURTLE, &sink); + SerdReader* reader = serd_reader_new(world, SERD_TURTLE, &sink, 4096); assert(reader); SerdNode* g = serd_node_new_uri("http://example.org/"); |