Example #1
0
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);
    }
}
Example #2
0
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());
}
Example #3
0
/* ------------------------------------------------------------------------- *
 * test_systemscreensaver
 * ------------------------------------------------------------------------- */
static void test_systemscreensaver(void)
{
  QSystemScreenSaver screensaver;

  X(screensaver.screenSaverInhibited());
  X(screensaver.setScreenSaverInhibit());
}