diff options
-rw-r--r-- | meson.build | 4 | ||||
-rw-r--r-- | src/world.c | 17 | ||||
-rw-r--r-- | test/bad_syntax.lv2/meson.build | 2 | ||||
-rw-r--r-- | test/failed_instantiation.lv2/meson.build | 2 | ||||
-rw-r--r-- | test/failed_lib_descriptor.lv2/meson.build | 2 | ||||
-rw-r--r-- | test/lib_descriptor.lv2/meson.build | 2 | ||||
-rw-r--r-- | test/lilv_test_utils.c | 2 | ||||
-rw-r--r-- | test/meson.build | 13 | ||||
-rw-r--r-- | test/missing_descriptor.lv2/meson.build | 2 | ||||
-rw-r--r-- | test/missing_name.lv2/meson.build | 2 | ||||
-rw-r--r-- | test/missing_plugin.lv2/meson.build | 2 | ||||
-rw-r--r-- | test/missing_port.lv2/meson.build | 2 | ||||
-rw-r--r-- | test/missing_port_name.lv2/meson.build | 2 | ||||
-rw-r--r-- | test/test_state.c | 2 |
14 files changed, 38 insertions, 18 deletions
diff --git a/meson.build b/meson.build index e72d1bb..0ac70be 100644 --- a/meson.build +++ b/meson.build @@ -73,9 +73,11 @@ if get_option('strict') '/wd4061', # enumerator in switch is not explicitly handled '/wd4365', # signed/unsigned mismatch '/wd4514', # unreferenced inline function has been removed + '/wd4706', # assignment within conditional expression '/wd4774', # format string is not a string literal '/wd4820', # padding added after construct '/wd4996', # POSIX name for this item is deprecated + '/wd5045', # compiler will insert Spectre mitigation ] endif @@ -154,6 +156,8 @@ else prog_args = ['-DLILV_STATIC'] endif +library_args += ['-DZIX_STATIC'] + # Build shared and/or static library/libraries liblilv = build_target( versioned_name, diff --git a/src/world.c b/src/world.c index 19522ae..9a311a9 100644 --- a/src/world.c +++ b/src/world.c @@ -574,11 +574,11 @@ lilv_world_load_dyn_manifest(LilvWorld* world, free(desc); } serd_cursor_free(p); - serd_free(plugins); + serd_model_free(plugins); lilv_free(lib_path); } serd_cursor_free(iter); - serd_free(model); + serd_model_free(model); #else (void)world; @@ -644,6 +644,7 @@ load_plugin_model(LilvWorld* world, serd_reader_start(reader, &manifest_in, bundle_uri, PAGE_SIZE); serd_reader_read_document(reader); serd_reader_finish(reader); + serd_close_input(&manifest_in); // Load any seeAlso files SerdModel* files = lilv_world_filter_model( @@ -1066,12 +1067,16 @@ lilv_world_load_file(LilvWorld* world, SerdReader* reader, const LilvNode* uri) (st = serd_reader_read_document(reader)) || (st = serd_reader_finish(reader))) { LILV_ERRORF("Error loading file `%s'\n", lilv_node_as_string(uri)); - return st; } - zix_tree_insert( - (ZixTree*)world->loaded_files, lilv_node_duplicate(uri), NULL); - return SERD_SUCCESS; + serd_close_input(&in); + + if (!st) { + zix_tree_insert( + (ZixTree*)world->loaded_files, lilv_node_duplicate(uri), NULL); + } + + return st; } int diff --git a/test/bad_syntax.lv2/meson.build b/test/bad_syntax.lv2/meson.build index 07e96d7..1b21dfd 100644 --- a/test/bad_syntax.lv2/meson.build +++ b/test/bad_syntax.lv2/meson.build @@ -17,7 +17,7 @@ endforeach test('bad_syntax', executable('test_bad_syntax', 'test_bad_syntax.c', - c_args: prog_args, + c_args: prog_args + ['-DLILV_STATIC'], dependencies: [lv2_dep, lilv_static_dep]), args: [meson.current_build_dir() / ''], suite: 'plugin') diff --git a/test/failed_instantiation.lv2/meson.build b/test/failed_instantiation.lv2/meson.build index 2221b4f..e9b0119 100644 --- a/test/failed_instantiation.lv2/meson.build +++ b/test/failed_instantiation.lv2/meson.build @@ -17,7 +17,7 @@ endforeach test('failed_instantiation', executable('test_failed_instantiation', 'test_failed_instantiation.c', - c_args: prog_args, + c_args: prog_args + ['-DLILV_STATIC'], dependencies: [lv2_dep, lilv_static_dep]), args: [meson.current_build_dir() / ''], suite: 'plugin') diff --git a/test/failed_lib_descriptor.lv2/meson.build b/test/failed_lib_descriptor.lv2/meson.build index b4c37f4..c601b06 100644 --- a/test/failed_lib_descriptor.lv2/meson.build +++ b/test/failed_lib_descriptor.lv2/meson.build @@ -17,7 +17,7 @@ endforeach test('failed_lib_descriptor', executable('test_failed_lib_descriptor', 'test_failed_lib_descriptor.c', - c_args: prog_args, + c_args: prog_args + ['-DLILV_STATIC'], dependencies: [lv2_dep, lilv_static_dep]), args: [meson.current_build_dir() / ''], suite: 'plugin') diff --git a/test/lib_descriptor.lv2/meson.build b/test/lib_descriptor.lv2/meson.build index 9006dfc..15d83f8 100644 --- a/test/lib_descriptor.lv2/meson.build +++ b/test/lib_descriptor.lv2/meson.build @@ -17,7 +17,7 @@ endforeach test('lib_descriptor', executable('test_lib_descriptor', 'test_lib_descriptor.c', - c_args: prog_args, + c_args: prog_args + ['-DLILV_STATIC'], dependencies: [lv2_dep, lilv_static_dep]), args: [meson.current_build_dir() / ''], suite: 'plugin') diff --git a/test/lilv_test_utils.c b/test/lilv_test_utils.c index fa79165..bfd3775 100644 --- a/test/lilv_test_utils.c +++ b/test/lilv_test_utils.c @@ -163,7 +163,7 @@ delete_bundle(LilvTestEnv* env) free(env->test_content_path); free(env->test_manifest_path); - free(env->test_bundle_uri); + serd_node_free(NULL, env->test_bundle_uri); free(env->test_bundle_path); env->test_content_path = NULL; diff --git a/test/meson.build b/test/meson.build index 597b765..775d3e9 100644 --- a/test/meson.build +++ b/test/meson.build @@ -46,13 +46,22 @@ define_args = [ '-DLILV_TEST_DIR="@0@/"'.format(meson.current_build_dir()), ] +test_args = prog_args + define_args + ['-DLILV_STATIC'] +if cc.get_id() == 'msvc' + test_args += [ + '/wd4191', # Unsafe conversion from 'FARPROC' + '/wd4464', # Relative include path contains '..' + '/wd5045', # Compiler will insert Spectre mitigation for memory load + ] +endif + foreach unit : unit_tests test(unit, executable('test_@0@'.format(unit), ['lilv_test_utils.c', 'test_@0@.c'.format(unit)], - c_args: prog_args + define_args, + c_args: test_args, include_directories: include_directories(['../src']), - dependencies: [lv2_dep, lilv_static_dep]), + dependencies: [lv2_dep, serd_dep, lilv_static_dep]), suite: 'unit') endforeach diff --git a/test/missing_descriptor.lv2/meson.build b/test/missing_descriptor.lv2/meson.build index 2112a99..cd21725 100644 --- a/test/missing_descriptor.lv2/meson.build +++ b/test/missing_descriptor.lv2/meson.build @@ -17,7 +17,7 @@ endforeach test('missing_descriptor', executable('test_missing_descriptor', 'test_missing_descriptor.c', - c_args: prog_args, + c_args: prog_args + ['-DLILV_STATIC'], dependencies: [lv2_dep, lilv_static_dep]), args: [meson.current_build_dir() / ''], suite: 'plugin') diff --git a/test/missing_name.lv2/meson.build b/test/missing_name.lv2/meson.build index 02979be..9897f70 100644 --- a/test/missing_name.lv2/meson.build +++ b/test/missing_name.lv2/meson.build @@ -17,7 +17,7 @@ endforeach test('missing_name', executable('test_missing_name', 'test_missing_name.c', - c_args: prog_args, + c_args: prog_args + ['-DLILV_STATIC'], dependencies: [lv2_dep, lilv_static_dep]), args: [meson.current_build_dir() / ''], suite: 'plugin') diff --git a/test/missing_plugin.lv2/meson.build b/test/missing_plugin.lv2/meson.build index 7197a33..40bbde2 100644 --- a/test/missing_plugin.lv2/meson.build +++ b/test/missing_plugin.lv2/meson.build @@ -17,7 +17,7 @@ endforeach test('missing_plugin', executable('test_missing_plugin', 'test_missing_plugin.c', - c_args: prog_args, + c_args: prog_args + ['-DLILV_STATIC'], dependencies: [lv2_dep, lilv_static_dep]), args: [meson.current_build_dir() / ''], suite: 'plugin') diff --git a/test/missing_port.lv2/meson.build b/test/missing_port.lv2/meson.build index c3f5461..f417de6 100644 --- a/test/missing_port.lv2/meson.build +++ b/test/missing_port.lv2/meson.build @@ -17,7 +17,7 @@ endforeach test('missing_port', executable('test_missing_port', 'test_missing_port.c', - c_args: prog_args, + c_args: prog_args + ['-DLILV_STATIC'], dependencies: [lv2_dep, lilv_static_dep]), args: [meson.current_build_dir() / ''], suite: 'plugin') diff --git a/test/missing_port_name.lv2/meson.build b/test/missing_port_name.lv2/meson.build index 806370b..dc69497 100644 --- a/test/missing_port_name.lv2/meson.build +++ b/test/missing_port_name.lv2/meson.build @@ -17,7 +17,7 @@ endforeach test('missing_port_name', executable('test_missing_port_name', 'test_missing_port_name.c', - c_args: prog_args, + c_args: prog_args + ['-DLILV_STATIC'], dependencies: [lv2_dep, lilv_static_dep]), args: [meson.current_build_dir() / ''], suite: 'plugin') diff --git a/test/test_state.c b/test/test_state.c index 5515382..1473584 100644 --- a/test/test_state.c +++ b/test/test_state.c @@ -562,7 +562,9 @@ count_statements(const char* path) SerdStatus st = SERD_SUCCESS; assert(!(st = serd_reader_start(reader, &in, NULL, 4096))); assert(!(st = serd_reader_read_document(reader))); + assert(!(st = serd_reader_finish(reader))); + serd_reader_free(reader); serd_close_input(&in); serd_sink_free(sink); serd_env_free(env); |