From 44e792d8da5ef93a88dac76b7b191e588203c42b Mon Sep 17 00:00:00 2001
From: David Robillard <d@drobilla.net>
Date: Sun, 28 Apr 2019 17:54:00 +0200
Subject: Replace serd_reader_set_strict() with SerdReaderFlags

This makes reader options extensible and should hopefully prevent the need for
grafting on more similar functions in the future.
---
 tests/overflow_test.c   |  4 +++-
 tests/read_chunk_test.c |  2 +-
 tests/serd_test.c       | 10 +++++-----
 3 files changed, 9 insertions(+), 7 deletions(-)

(limited to 'tests')

diff --git a/tests/overflow_test.c b/tests/overflow_test.c
index 917d02bf..918f1cc4 100644
--- a/tests/overflow_test.c
+++ b/tests/overflow_test.c
@@ -24,7 +24,9 @@
 static SerdStatus
 test(SerdWorld* world, SerdSink* sink, const char* str, size_t stack_size)
 {
-	SerdReader* reader = serd_reader_new(world, SERD_TURTLE, sink, stack_size);
+	SerdReader* reader =
+		serd_reader_new(world, SERD_TURTLE, 0, sink, stack_size);
+
 	serd_reader_start_string(reader, str, NULL);
 	const SerdStatus st = serd_reader_read_document(reader);
 	serd_reader_free(reader);
diff --git a/tests/read_chunk_test.c b/tests/read_chunk_test.c
index 56c6abdc..31b11603 100644
--- a/tests/read_chunk_test.c
+++ b/tests/read_chunk_test.c
@@ -80,7 +80,7 @@ main(void)
 	serd_sink_set_statement_func(sink, on_statement);
 	serd_sink_set_end_func(sink, on_end);
 
-	SerdReader* reader = serd_reader_new(world, SERD_TURTLE, sink, 4096);
+	SerdReader* reader = serd_reader_new(world, SERD_TURTLE, 0, sink, 4096);
 	assert(reader);
 
 	assert(!serd_reader_start_string(reader,
diff --git a/tests/serd_test.c b/tests/serd_test.c
index a42fe02a..599e948a 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -124,7 +124,7 @@ test_read_chunks(void)
 	assert(sink);
 	serd_sink_set_statement_func(sink, count_statements);
 
-	SerdReader* reader = serd_reader_new(world, SERD_TURTLE, sink, 4096);
+	SerdReader* reader = serd_reader_new(world, SERD_TURTLE, 0, sink, 4096);
 	assert(reader);
 	assert(f);
 
@@ -206,7 +206,7 @@ test_strict_write(void)
 	SerdEnv*    env    = serd_env_new(NULL);
 	SerdWriter* writer = serd_writer_new(world,
 	                                     SERD_TURTLE,
-	                                     SERD_WRITE_STRICT,
+	                                     0,
 	                                     env,
 	                                     (SerdWriteFunc)fwrite,
 	                                     fd);
@@ -239,7 +239,7 @@ test_read_string(void)
 	SerdWorld*  world        = serd_world_new();
 	size_t      n_statements = 0;
 	SerdSink*   sink         = serd_sink_new(&n_statements, NULL);
-	SerdReader* reader       = serd_reader_new(world, SERD_TURTLE, sink, 4096);
+	SerdReader* reader = serd_reader_new(world, SERD_TURTLE, 0, sink, 4096);
 	assert(reader);
 
 	serd_sink_set_statement_func(sink, count_statements);
@@ -657,7 +657,7 @@ test_writer(const char* const path)
 
 	SerdWriter* writer = serd_writer_new(world,
 	                                     SERD_TURTLE,
-	                                     0,
+	                                     SERD_WRITE_LAX,
 	                                     env,
 	                                     (SerdWriteFunc)fwrite,
 	                                     fd);
@@ -772,7 +772,7 @@ test_reader(const char* path)
 	SerdSink* sink         = serd_sink_new(&n_statements, NULL);
 	serd_sink_set_statement_func(sink, count_statements);
 
-	SerdReader* reader = serd_reader_new(world, SERD_TURTLE, sink, 4096);
+	SerdReader* reader = serd_reader_new(world, SERD_TURTLE, 0, sink, 4096);
 	assert(reader);
 
 	serd_reader_add_blank_prefix(reader, "tmp");
-- 
cgit v1.2.1