summaryrefslogtreecommitdiffstats
path: root/test/lilv_test.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-01-17 18:28:43 +0000
committerDavid Robillard <d@drobilla.net>2012-01-17 18:28:43 +0000
commit1ad081967284c99a5f86ff7b7e84416c0a601281 (patch)
tree00b637f5285c29b767f273ff4cb4b6b261bcbcf3 /test/lilv_test.c
parent33b20e5c20b0bbac5db9d8022ee5499b8cb95b5c (diff)
downloadlilv-1ad081967284c99a5f86ff7b7e84416c0a601281.tar.gz
lilv-1ad081967284c99a5f86ff7b7e84416c0a601281.tar.bz2
lilv-1ad081967284c99a5f86ff7b7e84416c0a601281.zip
Remove use of wordexp.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3957 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'test/lilv_test.c')
-rw-r--r--test/lilv_test.c48
1 files changed, 42 insertions, 6 deletions
diff --git a/test/lilv_test.c b/test/lilv_test.c
index c5f2b93..c8c565a 100644
--- a/test/lilv_test.c
+++ b/test/lilv_test.c
@@ -17,15 +17,16 @@
#define _POSIX_C_SOURCE 200112L /* for setenv */
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <assert.h>
-#include <sys/stat.h>
-#include <limits.h>
+#include <ctype.h>
#include <float.h>
+#include <limits.h>
#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include "lilv/lilv.h"
#include "../src/lilv_internal.h"
@@ -382,6 +383,40 @@ test_discovery(void)
/*****************************************************************************/
int
+test_lv2_path(void)
+{
+ char* orig_lv2_path = lilv_strdup(getenv("LV2_PATH"));
+
+ setenv("LV2_PATH", "~/.lv2:/usr/local/lib/lv2:/usr/lib/lv2", 1);
+
+ LilvWorld* world = lilv_world_new();
+ lilv_world_load_all(world);
+
+ const LilvPlugins* plugins = lilv_world_get_all_plugins(world);
+ const size_t n_plugins = lilv_plugins_size(plugins);
+
+ lilv_world_free(world);
+
+ setenv("LV2_PATH", "$HOME/.lv2:/usr/local/lib/lv2:/usr/lib/lv2", 1);
+ world = lilv_world_new();
+ lilv_world_load_all(world);
+ plugins = lilv_world_get_all_plugins(world);
+ TEST_ASSERT(lilv_plugins_size(plugins) == n_plugins);
+ lilv_world_free(world);
+
+ if (orig_lv2_path) {
+ setenv("LV2_PATH", orig_lv2_path, 1);
+ } else {
+ unsetenv("LV2_PATH");
+ }
+ free(orig_lv2_path);
+
+ return 1;
+}
+
+/*****************************************************************************/
+
+int
test_verify(void)
{
if (!start_bundle(MANIFEST_PREFIXES
@@ -1398,6 +1433,7 @@ static struct TestCase tests[] = {
TEST_CASE(verify),
TEST_CASE(no_verify),
TEST_CASE(discovery),
+ TEST_CASE(lv2_path),
TEST_CASE(classes),
TEST_CASE(plugin),
TEST_CASE(port),