From a1f4e968563763435027a905be8349cda1974e00 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 6 May 2017 16:31:29 +0200 Subject: Get rid of platform dependent usleep/SleepEx. --- test/uitests/filebrowsertest.cc | 16 +++------------- test/uitests/framewidgettest.cc | 16 +++------------- test/uitests/resizetest.cc | 16 +++------------- test/uitests/tabwidgettest.cc | 16 +++------------- 4 files changed, 12 insertions(+), 52 deletions(-) (limited to 'test') 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 - -#include - -#if DG_PLATFORM == DG_PLATFORM_WINDOWS -#define WIN32_LEAN_AND_MEAN -#include -#endif -#include +#include +#include #include #include @@ -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 - -#include - -#if DG_PLATFORM == DG_PLATFORM_WINDOWS -#define WIN32_LEAN_AND_MEAN -#include -#endif -#include +#include +#include #include #include @@ -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 - -#include - -#if DG_PLATFORM == DG_PLATFORM_WINDOWS -#define WIN32_LEAN_AND_MEAN -#include -#endif -#include +#include +#include #include #include @@ -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 - -#include - -#if DG_PLATFORM == DG_PLATFORM_WINDOWS -#define WIN32_LEAN_AND_MEAN -#include -#endif -#include +#include +#include #include #include @@ -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; -- cgit v1.2.3