summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-07-27 18:07:05 -0400
committerDavid Robillard <d@drobilla.net>2016-07-27 18:07:05 -0400
commit77c9b5518299ee401e95cb81aaf18a27900341c8 (patch)
tree45c4b9111a05854160e9de94db297e34ddcc5f81
parent9d956f95b7adbe5b535b903b5e6a64fb093b8645 (diff)
downloadingen-77c9b5518299ee401e95cb81aaf18a27900341c8.tar.gz
ingen-77c9b5518299ee401e95cb81aaf18a27900341c8.tar.bz2
ingen-77c9b5518299ee401e95cb81aaf18a27900341c8.zip
Add unit tests for Copy
-rw-r--r--src/server/events/Copy.cpp2
-rw-r--r--tests/copy_node.ttl16
-rw-r--r--tests/load_graph.ttl8
-rw-r--r--tests/save_graph.ttl8
4 files changed, 33 insertions, 1 deletions
diff --git a/src/server/events/Copy.cpp b/src/server/events/Copy.cpp
index e0438c9d..eed68d75 100644
--- a/src/server/events/Copy.cpp
+++ b/src/server/events/Copy.cpp
@@ -97,7 +97,7 @@ Copy::engine_to_engine()
return Event::pre_process_done(Status::BAD_REQUEST);
}
- // Ensure the new node doesn't already exists
+ // Ensure the new node doesn't already exist
if (_engine.store()->find(new_path) != _engine.store()->end()) {
return Event::pre_process_done(Status::EXISTS, new_path);
}
diff --git a/tests/copy_node.ttl b/tests/copy_node.ttl
new file mode 100644
index 00000000..7204f44b
--- /dev/null
+++ b/tests/copy_node.ttl
@@ -0,0 +1,16 @@
+@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
+@prefix patch: <http://lv2plug.in/ns/ext/patch#> .
+@prefix ingen: <http://drobilla.net/ns/ingen#> .
+
+<msg0>
+ a patch:Put ;
+ patch:subject <ingen:/graph/node> ;
+ patch:body [
+ a ingen:Block ;
+ lv2:prototype <http://drobilla.net/plugins/mda/Shepard>
+ ] .
+
+<msg1>
+ a patch:Copy ;
+ patch:subject <ingen:/graph/node> ;
+ patch:destination <ingen:/graph/copy> .
diff --git a/tests/load_graph.ttl b/tests/load_graph.ttl
new file mode 100644
index 00000000..4d21cae8
--- /dev/null
+++ b/tests/load_graph.ttl
@@ -0,0 +1,8 @@
+@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
+@prefix patch: <http://lv2plug.in/ns/ext/patch#> .
+@prefix ingen: <http://drobilla.net/ns/ingen#> .
+
+<msg0>
+ a patch:Copy ;
+ patch:subject <empty.ingen/> ;
+ patch:destination <ingen:/graph/> .
diff --git a/tests/save_graph.ttl b/tests/save_graph.ttl
new file mode 100644
index 00000000..840c4950
--- /dev/null
+++ b/tests/save_graph.ttl
@@ -0,0 +1,8 @@
+@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
+@prefix patch: <http://lv2plug.in/ns/ext/patch#> .
+@prefix ingen: <http://drobilla.net/ns/ingen#> .
+
+<msg0>
+ a patch:Copy ;
+ patch:subject <ingen:/graph/> ;
+ patch:destination <file:///tmp/savetest.ingen/> .