void tst_QSystemScreenSaver::tst_screenSaverInhibited() { QSystemScreenSaver si; QDesktopWidget wid; bool enabled = si.setScreenSaverInhibit(); if(wid.screenCount() > 0) { QVERIFY( si.screenSaverInhibited() && enabled); } else{ QVERIFY(!si.screenSaverInhibited() && !enabled); } }
void tst_QSystemScreenSaver::tst_setScreenSaverInhibited() { QSystemScreenSaver si; QDesktopWidget wid; si.setScreenSaverInhibited(true); if(wid.screenCount() > 0) { QVERIFY(si.screenSaverInhibited()); } else{ QVERIFY(!si.screenSaverInhibited()); } si.setScreenSaverInhibited(false); QVERIFY(!si.screenSaverInhibited()); }
/* ------------------------------------------------------------------------- * * test_systemscreensaver * ------------------------------------------------------------------------- */ static void test_systemscreensaver(void) { QSystemScreenSaver screensaver; X(screensaver.screenSaverInhibited()); X(screensaver.setScreenSaverInhibit()); }