aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_reader_writer.c
AgeCommit message (Collapse)AuthorFilesLines
2023-12-02Replace serd_reader_set_strict() with SerdReaderFlagsDavid Robillard1-5/+5
2023-12-02Split out simple reader unit testsDavid Robillard1-317/+3
2023-12-02Reduce complexity of statement writing functionsDavid Robillard1-1/+1
2023-12-02Add a set of limits to the worldDavid Robillard1-8/+14
The idea here is to remove the burden of passing things around like stack sizes (where most users don't care and will be happy with a reasonably large default) and keeping the call sites to things like serd_reader_new() clean. The cost is a bit more state, so it's both more powerful and more potentially flaky, since changing the limits has action at a distance that isn't clear from the call site. I think it's worth it for the cleaner API in the common case, and the much better forward compatibility.
2023-12-02Replace SERD_WRITE_STRICT flag with SERD_WRITE_LAXDavid Robillard1-6/+5
The unset value for flags should represent the best default, which in this case is strict parsing. Lax parsing is the riskier opt-in option.
2023-12-02Replace multiple stream callbacks with SerdEventDavid Robillard1-129/+87
This makes plumbing easier since everything goes through the same "stream" and only one callback is required to handling everything. It's also more easily extensible in case more event types need to be added in the future.
2023-12-02Simplify writer style options and write UTF-8 by defaultDavid Robillard1-2/+1
2023-12-02Add SerdStatementDavid Robillard1-10/+4
2023-12-02Add SerdCaretDavid Robillard1-2/+3
2023-12-02Remove serd_reader_set_default_graph()David Robillard1-14/+7
2023-12-02Add SerdWorld for shared library stateDavid Robillard1-27/+31
2023-12-02Clean up nodes in reader/writer testsDavid Robillard1-12/+20
2023-12-02Use a fixed-size reader stackDavid Robillard1-8/+12
2023-12-02Simplify reader interfaceDavid Robillard1-32/+38
2023-12-02Add SerdSink interface and hide implementationsDavid Robillard1-56/+53
2023-12-02Bring read/write interface closer to the C standardDavid Robillard1-7/+14
2023-12-02Simplify literal construction APIDavid Robillard1-3/+2
2023-12-02Simplify node construction APIDavid Robillard1-23/+32
2023-12-02Merge datatype/language into nodeDavid Robillard1-43/+15
This moves closer to the sord API, and is more convenient in most cases.
2023-12-02Make nodes opaqueDavid Robillard1-59/+48
2023-12-02Use more human-readable status codesDavid Robillard1-1/+1
2023-12-02Split up public API headerDavid Robillard1-1/+12
2023-12-02Remove "get" from accessor namesDavid Robillard1-5/+5
2023-12-02Rename function types for consistencyDavid Robillard1-4/+4
2023-12-02Rename SerdStyle to SerdWriterFlagsDavid Robillard1-7/+8
2023-12-02Add SerdBuffer type for mutable buffersDavid Robillard1-11/+11
This avoids const violations from abusing SerdChunk as a mutable buffer for string sinks.
2023-12-02Use char* for strings in public APIDavid Robillard1-31/+29
The constant casting just makes user code a mess, for no benefit.
2023-05-03Make serd_reader_read_chunk() work with NQuadsDavid Robillard1-7/+101
2023-04-16Gracefully handle errors when writing textDavid Robillard1-0/+97
2023-04-02Improve TriG pretty-printing and remove trailing newlinesDavid Robillard1-2/+2
2022-11-25Avoid use of tmpfile()David Robillard1-28/+35
Somewhat temporary solution, since we'll soon be able to use zix here which has nice portable functions to create temporary files.
2022-11-25Avoid creating test files in the current directoryDavid Robillard1-1/+21
2022-11-25Merge similar testsDavid Robillard1-33/+119
2022-11-24Check serd_writer_write_statement() return valueDavid Robillard1-2/+2
2022-10-23Fix crash when trying to read chunks without startingDavid Robillard1-0/+2
2022-08-31Adopt REUSE machine-readable licensing standardDavid Robillard1-15/+2
2021-07-10Fix out of bounds read in testDavid Robillard1-0/+4
2021-07-10Clean up socket-like stream reading testDavid Robillard1-5/+17
2021-04-09Write statements with invalid URI characters in lax modeDavid Robillard1-0/+1
2021-01-02Use email address instead of website for attributionDavid Robillard1-1/+1
2020-12-31Format all code with clang-formatDavid Robillard1-261/+268
2020-11-13Remove tests that pass null to nonnull parametersDavid Robillard1-6/+2
2020-11-11Add nonnull and nullable attributes to APIDavid Robillard1-0/+8
This will warn if NULL is passed to any nonnull-annotated parameter, and is also supported by sanitizers which can check for violations at runtime. Unfortunately, it is currently only supported by clang. GCC has a similar feature in the nonnull attribute, but this has a different syntax (it's a function attribute) and is more dangerous since it is used by the optimizer to assume a null pointer is undefined behavior. This one just warns and still allows code to handle the situation gracefully, which I think is more appropriate for a library API. Note that this optimization behavior is not some unlikely edge case: switching these attributes to the GCC one will break release builds.
2020-11-09Add a test for reading strings with no trailing newlineDavid Robillard1-0/+23
2020-11-09Split out reader and writer testsDavid Robillard1-0/+329