summaryrefslogtreecommitdiffstats
path: root/tests/ingen_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ingen_test.cpp')
-rw-r--r--tests/ingen_test.cpp74
1 files changed, 5 insertions, 69 deletions
diff --git a/tests/ingen_test.cpp b/tests/ingen_test.cpp
index 1ac2e383..d55789db 100644
--- a/tests/ingen_test.cpp
+++ b/tests/ingen_test.cpp
@@ -51,78 +51,13 @@
#include "ingen/runtime_paths.hpp"
#include "ingen/types.hpp"
+#include "TestClient.hpp"
+
using namespace std;
using namespace Ingen;
World* world = NULL;
-class TestClient : public Interface
-{
-public:
- explicit TestClient(Log& log) : _log(log) {}
- ~TestClient() {}
-
- Raul::URI uri() const { return Raul::URI("ingen:testClient"); }
-
- void bundle_begin() {}
-
- void bundle_end() {}
-
- void put(const Raul::URI& uri,
- const Properties& properties,
- Resource::Graph ctx = Resource::Graph::DEFAULT) {}
-
- void delta(const Raul::URI& uri,
- const Properties& remove,
- const Properties& add) {}
-
- void copy(const Raul::URI& old_uri,
- const Raul::URI& new_uri) {}
-
- void move(const Raul::Path& old_path,
- const Raul::Path& new_path) {}
-
- void del(const Raul::URI& uri) {}
-
- void connect(const Raul::Path& tail,
- const Raul::Path& head) {}
-
- void disconnect(const Raul::Path& tail,
- const Raul::Path& head) {}
-
- void disconnect_all(const Raul::Path& parent_patch_path,
- const Raul::Path& path) {}
-
- void set_property(const Raul::URI& subject,
- const Raul::URI& predicate,
- const Atom& value) {}
-
- void set_response_id(int32_t id) {}
-
- void get(const Raul::URI& uri) {}
-
- void undo() {}
-
- void redo() {}
-
- void response(int32_t id, Status status, const std::string& subject) {
- if (status != Status::SUCCESS) {
- _log.error(fmt("error on message %1%: %2% (%3%)\n")
- % id % ingen_status_string(status) % subject);
- exit(EXIT_FAILURE);
- }
- }
-
- void error(const std::string& msg) {
- _log.error(fmt("error: %1%\n") % msg);
- exit(EXIT_FAILURE);
- }
-
-private:
- Log& _log;
-};
-
-
static void
ingen_try(bool cond, const char* msg)
{
@@ -158,7 +93,8 @@ main(int argc, char** argv)
// Create world
try {
- world = new World(argc, argv, NULL, NULL, NULL);
+ world = new World(NULL, NULL, NULL);
+ world->load_configuration(argc, argv);
} catch (std::exception& e) {
cout << "ingen: " << e.what() << endl;
return EXIT_FAILURE;
@@ -194,7 +130,7 @@ main(int argc, char** argv)
world->engine()->init(48000.0, 4096, 4096);
world->engine()->activate();
- // Load patch
+ // Load graph
if (!world->parser()->parse_file(world, world->interface().get(), start_graph)) {
cerr << "error: failed to load initial graph " << start_graph << endl;
return EXIT_FAILURE;