diff options
author | David Robillard <d@drobilla.net> | 2020-06-28 19:46:47 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-13 23:04:17 -0500 |
commit | cae15d15c847faba203e40e2a327b23a1ebffb48 (patch) | |
tree | 17d1e637673ef45c3afdc3c43b67f0b023b8d851 /test/test_byte_sink.c | |
parent | 900d360027d570da085d495becde1ad50f050048 (diff) | |
download | serd-cae15d15c847faba203e40e2a327b23a1ebffb48.tar.gz serd-cae15d15c847faba203e40e2a327b23a1ebffb48.tar.bz2 serd-cae15d15c847faba203e40e2a327b23a1ebffb48.zip |
Make Writer always write to a ByteSink
Diffstat (limited to 'test/test_byte_sink.c')
-rw-r--r-- | test/test_byte_sink.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/test_byte_sink.c b/test/test_byte_sink.c new file mode 100644 index 00000000..1982a436 --- /dev/null +++ b/test/test_byte_sink.c @@ -0,0 +1,32 @@ +/* + Copyright 2021 David Robillard <d@drobilla.net> + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#undef NDEBUG + +#include "serd/serd.h" + +#include <assert.h> +#include <stdio.h> + +int +main(void) +{ + assert(!serd_byte_sink_new_filename("file.ttl", 0)); + assert(!serd_byte_sink_new_filename("/does/not/exist.ttl", 1)); + assert(!serd_byte_sink_new_function((SerdWriteFunc)fwrite, NULL, 0)); + + return 0; +} |