Skip to content

Commit f71051e

Browse files
authored
Tests: Don't enable HW accel as side-effect (#557)
The Settings test attempts to test the class by changing settings variables and reading them back again. Problem is, that affects the REST of the unit tests. So instead of enabling HW accel and causing crashes, we'll diddle something innocuous, like OMP_THREADS.
1 parent d121f9d commit f71051e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/Settings_Tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ TEST(Settings_Default_Constructor)
4141
// Create an empty color
4242
Settings *s = Settings::Instance();
4343

44-
CHECK_EQUAL(0, s->HARDWARE_DECODER);
44+
CHECK_EQUAL(12, s->OMP_THREADS);
4545
CHECK_EQUAL(false, s->HIGH_QUALITY_SCALING);
4646
CHECK_EQUAL(false, s->WAIT_FOR_VIDEO_PROCESSING_TASK);
4747
}
@@ -50,15 +50,15 @@ TEST(Settings_Change_Settings)
5050
{
5151
// Create an empty color
5252
Settings *s = Settings::Instance();
53-
s->HARDWARE_DECODER = 1;
53+
s->OMP_THREADS = 8;
5454
s->HIGH_QUALITY_SCALING = true;
5555
s->WAIT_FOR_VIDEO_PROCESSING_TASK = true;
5656

57-
CHECK_EQUAL(1, s->HARDWARE_DECODER);
57+
CHECK_EQUAL(8, s->OMP_THREADS);
5858
CHECK_EQUAL(true, s->HIGH_QUALITY_SCALING);
5959
CHECK_EQUAL(true, s->WAIT_FOR_VIDEO_PROCESSING_TASK);
6060

61-
CHECK_EQUAL(1, s->HARDWARE_DECODER);
61+
CHECK_EQUAL(8, Settings::Instance()->OMP_THREADS);
6262
CHECK_EQUAL(true, Settings::Instance()->HIGH_QUALITY_SCALING);
6363
CHECK_EQUAL(true, Settings::Instance()->WAIT_FOR_VIDEO_PROCESSING_TASK);
6464
}

0 commit comments

Comments
 (0)