Skip to content

Commit

Permalink
Add some constness in DoubleSliderTest.cpp file.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Dec 25, 2024
1 parent 038cc45 commit 80bdda7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/DoubleSliderTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ void DoubleSliderTest::testEmittingCurrentMinChanged()
{
DoubleSlider slider(MIN, MAX);

QSignalSpy spyMin(&slider, &DoubleSlider::currentMinChanged);
QSignalSpy spyMax(&slider, &DoubleSlider::currentMaxChanged);
const QSignalSpy spyMin(&slider, &DoubleSlider::currentMinChanged);
const QSignalSpy spyMax(&slider, &DoubleSlider::currentMaxChanged);

const double newMin{MIN / 2.};
slider.setCurrentMin(newMin);
Expand All @@ -45,10 +45,10 @@ void DoubleSliderTest::testEmittingCurrentMinChanged()

void DoubleSliderTest::testEmittingCurrentMaxChanged()
{
DoubleSlider slider(MIN, MAX);
const DoubleSlider slider(MIN, MAX);

QSignalSpy spyMin(&slider, &DoubleSlider::currentMinChanged);
QSignalSpy spyMax(&slider, &DoubleSlider::currentMaxChanged);
const QSignalSpy spyMin(&slider, &DoubleSlider::currentMinChanged);
const QSignalSpy spyMax(&slider, &DoubleSlider::currentMaxChanged);

QCOMPARE(spyMin.count(), NO_SIGNAL);
QCOMPARE(spyMax.count(), NO_SIGNAL);
Expand Down Expand Up @@ -82,7 +82,7 @@ void DoubleSliderTest::testMovingLeftHandle()
slider.resize(SLIDER_WIDTH, SLIDER_HEIGHT);

QSignalSpy spyMin(&slider, &DoubleSlider::currentMinChanged);
QSignalSpy spyMax(&slider, &DoubleSlider::currentMaxChanged);
const QSignalSpy spyMax(&slider, &DoubleSlider::currentMaxChanged);

const QPoint startPoint(0, 0);
const QPoint endPoint(SLIDER_WIDTH / 2, 0);
Expand All @@ -103,7 +103,7 @@ void DoubleSliderTest::testMovingRightHandle()
DoubleSlider slider(MIN, MAX);
slider.resize(SLIDER_WIDTH, SLIDER_HEIGHT);

QSignalSpy spyMin(&slider, &DoubleSlider::currentMinChanged);
const QSignalSpy spyMin(&slider, &DoubleSlider::currentMinChanged);
QSignalSpy spyMax(&slider, &DoubleSlider::currentMaxChanged);

const QPoint startPoint(SLIDER_WIDTH, 0);
Expand Down

0 comments on commit 80bdda7

Please sign in to comment.