summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit/timer.cxx
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dave@treblig.org>2023-05-25 01:31:11 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-05-29 14:48:37 +0200
commitb20eb3367436de4fb189dc82d14412539c02d30c (patch)
treed806c7df14c3d3da325e2b8adac7de0fcb5a0325 /vcl/qa/cppunit/timer.cxx
parentda398ad3bb511e33451f9d3bf24b0c5abd55ce25 (diff)
cppunit/timer: Use a range based loop and cleanup
Use a range based loop in testDurations re tdf#145538 which also nails a SAL_N_ELEMENTS tdf#147021 and takes out a sal_uLong tdf#114441 while here, clean out the rest of the sal_uLong's in that file to be sal_uInt64 to match timer.hxx which was changed by 9c7016b5b5 way back in 2015. Change-Id: Ie065885939a340d9a73af797fb4d7d6f76530242 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152250 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/qa/cppunit/timer.cxx')
-rw-r--r--vcl/qa/cppunit/timer.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/vcl/qa/cppunit/timer.cxx b/vcl/qa/cppunit/timer.cxx
index 15493b953639..467d7b1a776d 100644
--- a/vcl/qa/cppunit/timer.cxx
+++ b/vcl/qa/cppunit/timer.cxx
@@ -160,7 +160,7 @@ class TimerBool : public Timer
{
bool &mrBool;
public:
- TimerBool( sal_uLong nMS, bool &rBool ) :
+ TimerBool( sal_uInt64 nMS, bool &rBool ) :
Timer( "TimerBool" ), mrBool( rBool )
{
SetTimeout( nMS );
@@ -178,11 +178,10 @@ public:
void TimerTest::testDurations()
{
- static const sal_uLong aDurations[] = { 0, 1, 500, 1000 };
- for (size_t i = 0; i < SAL_N_ELEMENTS( aDurations ); i++)
+ for (auto const nDuration : { 0, 1, 500, 1000 })
{
bool bDone = false;
- TimerBool aTimer( aDurations[i], bDone );
+ TimerBool aTimer( nDuration, bDone );
// coverity[loop_top] - Application::Yield allows the timer to fire and toggle bDone
while( !bDone )
{
@@ -199,7 +198,7 @@ class AutoTimerCount : public AutoTimer
const sal_Int32 mnMaxCount;
public:
- AutoTimerCount( sal_uLong nMS, sal_Int32 &rCount,
+ AutoTimerCount( sal_uInt64 nMS, sal_Int32 &rCount,
const sal_Int32 nMaxCount = -1 )
: AutoTimer( "AutoTimerCount" )
, mrCount( rCount )
@@ -340,7 +339,7 @@ namespace {
class YieldTimer : public Timer
{
public:
- explicit YieldTimer( sal_uLong nMS ) : Timer( "YieldTimer" )
+ explicit YieldTimer( sal_uInt64 nMS ) : Timer( "YieldTimer" )
{
SetTimeout( nMS );
Start();
@@ -370,7 +369,7 @@ class SlowCallbackTimer : public Timer
{
bool &mbSlow;
public:
- SlowCallbackTimer( sal_uLong nMS, bool &bBeenSlow ) :
+ SlowCallbackTimer( sal_uInt64 nMS, bool &bBeenSlow ) :
Timer( "SlowCallbackTimer" ), mbSlow( bBeenSlow )
{
SetTimeout( nMS );