#ifndef _TEST_UTILS_H_ #define _TEST_UTILS_H_ 1 #include "irrlicht.h" #include // Small hack. Some newer X11 systems can't handle switching drivers too fast (causing BadWindow errors in X_ChangeWindowAttributes). // Could be they don't like when Windows with different Visuals are created very quickly (it always happened after creating a new Window with different Visual to previous one). // timeMs value set by try&error #ifdef _IRR_POSIX_API_ #include #define SLOW_SWITCH \ do { \ struct timespec ts; \ const int timeMs = 250; \ ts.tv_sec = (time_t) (timeMs / 1000); \ ts.tv_nsec = (long) (timeMs % 1000) * 1000000; \ nanosleep(&ts, NULL);\ } while (false) #else #define SLOW_SWITCH #endif #define TestWithAllDrivers(X) \ logTestString("Running test " #X "\n"); \ for (u32 i=1; i