vcl/qa/cppunit/timer.cxx |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

New commits:
commit b20eb3367436de4fb189dc82d14412539c02d30c
Author:     Dr. David Alan Gilbert <d...@treblig.org>
AuthorDate: Thu May 25 01:31:11 2023 +0100
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon May 29 14:48:37 2023 +0200

    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.gran...@collabora.co.uk>

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 );

Reply via email to