aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_reader.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/test/test_reader.c b/test/test_reader.c
index cfaa8bed..18794f9e 100644
--- a/test/test_reader.c
+++ b/test/test_reader.c
@@ -219,6 +219,7 @@ test_read_eof_by_byte(void)
assert(serd_reader_read_chunk(reader) == SERD_SUCCESS);
assert(serd_reader_read_chunk(reader) == SERD_FAILURE);
+ serd_reader_end_stream(reader);
serd_reader_free(reader);
}
@@ -243,7 +244,7 @@ test_read_nquads_chunks(const char* const path)
fprintf(f,
"<http://example.org/s> <http://example.org/p3> "
- "<http://example.org/o3> .\n");
+ "<http://example.org/o3> .");
fseek(f, 0, SEEK_SET);
@@ -260,7 +261,9 @@ test_read_nquads_chunks(const char* const path)
assert(serd_reader_get_handle(reader) == &rt);
assert(f);
- SerdStatus st = serd_reader_start_stream(reader, f, NULL, false);
+ SerdStatus st = serd_reader_start_source_stream(
+ reader, (SerdSource)fread, (SerdStreamErrorFunc)ferror, f, NULL, 32U);
+
assert(st == SERD_SUCCESS);
// Read first statement
@@ -304,7 +307,7 @@ test_read_nquads_chunks(const char* const path)
assert(rt.n_end == 0);
assert(serd_reader_read_chunk(reader) == SERD_FAILURE);
-
+ serd_reader_end_stream(reader);
serd_reader_free(reader);
fclose(f);
remove(path);
@@ -323,8 +326,7 @@ test_read_turtle_chunks(const char* const path)
fprintf(f, "eg:s eg:p1 eg:o1 ;\n");
fprintf(f, " eg:p2 eg:o2 .\n");
fwrite(&null, sizeof(null), 1, f);
- fprintf(f, "eg:s eg:p [ eg:sp eg:so ] .\n");
- fwrite(&null, sizeof(null), 1, f);
+ fprintf(f, "eg:s eg:p [ eg:sp eg:so ] .");
fseek(f, 0, SEEK_SET);
ReaderTest rt = {0, 0, 0, 0};
@@ -340,7 +342,8 @@ test_read_turtle_chunks(const char* const path)
assert(serd_reader_get_handle(reader) == &rt);
assert(f);
- SerdStatus st = serd_reader_start_stream(reader, f, NULL, false);
+ SerdStatus st = serd_reader_start_source_stream(
+ reader, (SerdSource)fread, (SerdStreamErrorFunc)ferror, f, NULL, 32U);
assert(st == SERD_SUCCESS);
// Read base
@@ -400,7 +403,7 @@ test_read_turtle_chunks(const char* const path)
assert(rt.n_end == 1);
assert(serd_reader_read_chunk(reader) == SERD_FAILURE);
-
+ serd_reader_end_stream(reader);
serd_reader_free(reader);
fclose(f);
remove(path);