summaryrefslogtreecommitdiffstats
path: root/tests/ingen_test.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-07-30 08:31:54 -0400
committerDavid Robillard <d@drobilla.net>2016-07-30 08:31:54 -0400
commit59ec230f9812354b855ef5842c3362caa71e8fe0 (patch)
tree22a14c64d09f27fa6bb26a535a27389eaebcfc3a /tests/ingen_test.cpp
parent22e34e9132668b9b87a765c090ff86e449d01273 (diff)
downloadingen-59ec230f9812354b855ef5842c3362caa71e8fe0.tar.gz
ingen-59ec230f9812354b855ef5842c3362caa71e8fe0.tar.bz2
ingen-59ec230f9812354b855ef5842c3362caa71e8fe0.zip
Clean up tests
Diffstat (limited to 'tests/ingen_test.cpp')
-rw-r--r--tests/ingen_test.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/ingen_test.cpp b/tests/ingen_test.cpp
index 542636a2..ee2c4924 100644
--- a/tests/ingen_test.cpp
+++ b/tests/ingen_test.cpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
+ Copyright 2007-2016 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -126,6 +126,16 @@ ingen_try(bool cond, const char* msg)
}
}
+static void
+flush_events(Ingen::World* world)
+{
+ while (world->engine()->pending_events()) {
+ world->engine()->run(4096);
+ world->engine()->main_iteration();
+ g_usleep(1000);
+ }
+}
+
int
main(int argc, char** argv)
{
@@ -175,11 +185,7 @@ main(int argc, char** argv)
cerr << "error: failed to load initial graph " << start_graph << endl;
return EXIT_FAILURE;
}
- while (world->engine()->pending_events()) {
- world->engine()->run(4096);
- world->engine()->main_iteration();
- g_usleep(1000);
- }
+ flush_events(world);
// Read commands