summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit/timer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/qa/cppunit/timer.cxx')
-rw-r--r--vcl/qa/cppunit/timer.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/timer.cxx b/vcl/qa/cppunit/timer.cxx
index 90705d26ec19..03f295943ea1 100644
--- a/vcl/qa/cppunit/timer.cxx
+++ b/vcl/qa/cppunit/timer.cxx
@@ -27,6 +27,8 @@
// Enables timer tests that appear to provoke windows under load unduly.
//#define TEST_TIMERPRECISION
+namespace {
+
/// Avoid our timer tests just wedging the build if they fail.
class WatchDog : public osl::Thread
{
@@ -47,6 +49,8 @@ public:
}
};
+}
+
static WatchDog * aWatchDog = new WatchDog( 120 ); // random high number in secs
class TimerTest : public test::BootstrapFixture
@@ -102,6 +106,7 @@ void TimerTest::testWatchdog()
}
#endif
+namespace {
class IdleBool : public Idle
{
@@ -121,6 +126,8 @@ public:
}
};
+}
+
void TimerTest::testIdle()
{
bool bTriggered = false;
@@ -147,6 +154,8 @@ void TimerTest::testIdleMainloop()
CPPUNIT_ASSERT_MESSAGE("mainloop idle triggered", bTriggered);
}
+namespace {
+
class TimerBool : public Timer
{
bool &mrBool;
@@ -165,6 +174,8 @@ public:
}
};
+}
+
void TimerTest::testDurations()
{
static const sal_uLong aDurations[] = { 0, 1, 500, 1000 };
@@ -180,6 +191,7 @@ void TimerTest::testDurations()
}
}
+namespace {
class AutoTimerCount : public AutoTimer
{
@@ -207,6 +219,8 @@ public:
}
};
+}
+
#ifdef TEST_TIMERPRECISION
void TimerTest::testAutoTimer()
@@ -321,6 +335,7 @@ void TimerTest::testAutoTimerStop()
CPPUNIT_ASSERT( !Application::Reschedule() );
}
+namespace {
class YieldTimer : public Timer
{
@@ -337,6 +352,8 @@ public:
}
};
+}
+
void TimerTest::testNestedTimer()
{
sal_Int32 nCount = 0;
@@ -347,6 +364,7 @@ void TimerTest::testNestedTimer()
Application::Yield();
}
+namespace {
class SlowCallbackTimer : public Timer
{
@@ -366,6 +384,8 @@ public:
}
};
+}
+
void TimerTest::testSlowTimerCallback()
{
bool bBeenSlow = false;
@@ -380,6 +400,7 @@ void TimerTest::testSlowTimerCallback()
Application::Yield();
}
+namespace {
class TriggerIdleFromIdle : public Idle
{
@@ -401,6 +422,8 @@ public:
}
};
+}
+
void TimerTest::testTriggerIdleFromIdle()
{
bool bTriggered1 = false;
@@ -413,6 +436,7 @@ void TimerTest::testTriggerIdleFromIdle()
CPPUNIT_ASSERT_MESSAGE("idle not triggered", bTriggered2);
}
+namespace {
class IdleInvokedReStart : public Idle
{
@@ -431,6 +455,8 @@ public:
}
};
+}
+
void TimerTest::testInvokedReStart()
{
sal_Int32 nCount = 0;
@@ -439,6 +465,7 @@ void TimerTest::testInvokedReStart()
CPPUNIT_ASSERT_EQUAL( sal_Int32(2), nCount );
}
+namespace {
class IdleSerializer : public Idle
{
@@ -461,6 +488,8 @@ public:
}
};
+}
+
void TimerTest::testPriority()
{
// scope, so tasks are deleted
@@ -487,6 +516,7 @@ void TimerTest::testPriority()
}
}
+namespace {
class TestAutoIdleRR : public AutoIdle
{
@@ -506,6 +536,8 @@ public:
}
};
+}
+
IMPL_LINK_NOARG(TestAutoIdleRR, IdleRRHdl, Timer *, void)
{
++mrCount;