summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drumgizmo/drumgizmoc.cc8
-rw-r--r--plugingui/testmain.cc15
-rw-r--r--test/uitests/filebrowsertest.cc16
-rw-r--r--test/uitests/framewidgettest.cc16
-rw-r--r--test/uitests/resizetest.cc16
-rw-r--r--test/uitests/tabwidgettest.cc16
6 files changed, 18 insertions, 69 deletions
diff --git a/drumgizmo/drumgizmoc.cc b/drumgizmo/drumgizmoc.cc
index 97737d7..22313c0 100644
--- a/drumgizmo/drumgizmoc.cc
+++ b/drumgizmo/drumgizmoc.cc
@@ -34,6 +34,8 @@
#include <stdlib.h>
#include <unistd.h>
#include <sstream>
+#include <chrono>
+#include <thread>
#include <hugin.hpp>
@@ -428,11 +430,7 @@ int main(int argc, char* argv[])
{
while(settings.drumkit_load_status.load() != LoadStatus::Done)
{
-#ifdef WIN32
- SleepEx(10, FALSE);
-#else
- usleep(10000);
-#endif /*WIN32*/
+ std::this_thread::sleep_for(std::chrono::milliseconds(10));
int total = settings.number_of_files.load();
int loaded = settings.number_of_files_loaded.load();
diff --git a/plugingui/testmain.cc b/plugingui/testmain.cc
index d6c3220..5231205 100644
--- a/plugingui/testmain.cc
+++ b/plugingui/testmain.cc
@@ -24,13 +24,8 @@
* along with DrumGizmo; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include <platform.h>
-
-#if DG_PLATFORM == DG_PLATFORM_WINDOWS
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-#include <unistd.h>
+#include <chrono>
+#include <thread>
#include <hugin.hpp>
#include <settings.h>
@@ -63,11 +58,7 @@ int main()
break;
}
-#if DG_PLATFORM == DG_PLATFORM_WINDOWS
- SleepEx(50, FALSE);
-#else
- usleep(50000);
-#endif
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
return 0;
diff --git a/test/uitests/filebrowsertest.cc b/test/uitests/filebrowsertest.cc
index c558fab..5f78921 100644
--- a/test/uitests/filebrowsertest.cc
+++ b/test/uitests/filebrowsertest.cc
@@ -25,14 +25,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#include <iostream>
-
-#include <platform.h>
-
-#if DG_PLATFORM == DG_PLATFORM_WINDOWS
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-#include <unistd.h>
+#include <chrono>
+#include <thread>
#include <hugin.hpp>
#include <window.h>
@@ -135,11 +129,7 @@ int main()
while(test_window.processEvents())
{
-#if DG_PLATFORM == DG_PLATFORM_WINDOWS
- SleepEx(50, FALSE);
-#else
- usleep(50000);
-#endif
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
return 0;
diff --git a/test/uitests/framewidgettest.cc b/test/uitests/framewidgettest.cc
index 2b94688..a2a24db 100644
--- a/test/uitests/framewidgettest.cc
+++ b/test/uitests/framewidgettest.cc
@@ -25,14 +25,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#include <iostream>
-
-#include <platform.h>
-
-#if DG_PLATFORM == DG_PLATFORM_WINDOWS
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-#include <unistd.h>
+#include <chrono>
+#include <thread>
#include <button.h>
#include <checkbox.h>
@@ -180,11 +174,7 @@ int main()
while(test_window.processEvents())
{
-#ifdef WIN32
- SleepEx(50, FALSE);
-#else
- usleep(50000);
-#endif
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
return 0;
diff --git a/test/uitests/resizetest.cc b/test/uitests/resizetest.cc
index f5ba01b..5ede2b6 100644
--- a/test/uitests/resizetest.cc
+++ b/test/uitests/resizetest.cc
@@ -25,14 +25,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#include <iostream>
-
-#include <platform.h>
-
-#if DG_PLATFORM == DG_PLATFORM_WINDOWS
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-#include <unistd.h>
+#include <chrono>
+#include <thread>
#include <hugin.hpp>
#include <window.h>
@@ -135,11 +129,7 @@ int main()
while(test_window.processEvents())
{
-#if DG_PLATFORM == DG_PLATFORM_WINDOWS
- SleepEx(50, FALSE);
-#else
- usleep(50000);
-#endif
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
return 0;
diff --git a/test/uitests/tabwidgettest.cc b/test/uitests/tabwidgettest.cc
index 292991c..722dc02 100644
--- a/test/uitests/tabwidgettest.cc
+++ b/test/uitests/tabwidgettest.cc
@@ -25,14 +25,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#include <iostream>
-
-#include <platform.h>
-
-#if DG_PLATFORM == DG_PLATFORM_WINDOWS
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-#include <unistd.h>
+#include <chrono>
+#include <thread>
#include <hugin.hpp>
#include <window.h>
@@ -156,11 +150,7 @@ int main()
while(test_window.processEvents())
{
-#if DG_PLATFORM == DG_PLATFORM_WINDOWS
- SleepEx(50, FALSE);
-#else
- usleep(50000);
-#endif
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
return 0;