From 8bbac48a4cfb64251d8a67e4c01088c9151520f5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 3 Oct 2015 14:57:15 +0000 Subject: Fix using sordi with stdin Improve test coverage (100% of sordi.c). git-svn-id: http://svn.drobilla.net/sord/trunk@332 3d64ff67-21c5-427c-a301-fe4f08042e5a --- NEWS | 3 ++- src/sordi.c | 2 +- wscript | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index ec85fc9..77cde54 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ sord (0.13.1) unstable; * Fix crash caused by multiple deletion of datatype nodes * Fix compilation on compilers that do not support -pthread flag * Fix minor memory leak in sordi + * Fix using sordi with stdin * sord_validate: More extensive validation, including cardinality, PlainLiteral, and someValuesFrom restrictions. * This release does not break the ABI, but the semantics of iterators has @@ -13,7 +14,7 @@ sord (0.13.1) unstable; * Improve test coverage * Upgrade to waf 1.8.14 - -- David Robillard Fri, 02 Oct 2015 21:13:32 -0400 + -- David Robillard Sat, 03 Oct 2015 10:56:43 -0400 sord (0.12.2) stable; diff --git a/src/sordi.c b/src/sordi.c index 6ec5faf..257315a 100644 --- a/src/sordi.c +++ b/src/sordi.c @@ -159,7 +159,7 @@ main(int argc, char** argv) if (a < argc) { // Base URI given on command line base_uri_node = serd_node_new_uri_from_string( (const uint8_t*)argv[a], NULL, &base_uri); - } else if (from_file) { // Use input file URI + } else if (in_fd != stdin && from_file) { // Use input file URI base_uri_node = serd_node_new_file_uri(in_path, NULL, &base_uri, false); } diff --git a/wscript b/wscript index 3fb2cf4..fd52e29 100644 --- a/wscript +++ b/wscript @@ -279,6 +279,8 @@ def test(ctx): 'sordi_static -v > %s' % nul, 'sordi_static -h > %s' % nul, 'sordi_static -s " a <#Thingie> ." file:///test > %s' % nul, + 'echo "

." | sordi_static - http://example.org/', + 'echo "

." | sordi_static -o turtle - http://example.org/', 'sordi_static %s > %s' % (nul, nul)], 0, name='sordi-cmd-good') @@ -293,6 +295,8 @@ def test(ctx): 'sordi_static -i illegal > %s' % nul, 'sordi_static -o illegal > %s' % nul, 'sordi_static -i turtle > %s' % nul, + 'sordi_static -i ntriples > %s' % nul, + 'echo "

." | sordi_static -', 'sordi_static /no/such/file > %s' % nul], 1, name='sordi-cmd-bad') -- cgit v1.2.1