Skip to content

Commit

Permalink
BUG: Fix ctkSettingsPanelTest reading settings file as text
Browse files Browse the repository at this point in the history
This ensures newlines are always read as `/n` independently of the platform.

It fixes errors like the following:

```
126: FAIL!  : ctkSettingsPanelTester::testChangeProperty(null none changed obj) Compared values are not the same
126:    Actual   (currentSettingContent)             : "[General]\r\nproperty=2\r\n"
```
  • Loading branch information
jcfr committed Jan 14, 2024
1 parent ee04e40 commit fff6977
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Libs/Widgets/Testing/Cpp/ctkSettingsPanelTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void ctkSettingsPanelTester::testChangeProperty()
if (QFile::exists(settings.fileName()))
{
QFile file(settings.fileName());
QVERIFY(file.open(QIODevice::ReadOnly));
QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text));
currentSettingContent = file.readAll();
file.close();
}
Expand All @@ -117,7 +117,7 @@ void ctkSettingsPanelTester::testChangeProperty()
if (QFile::exists(specificSettings.fileName()))
{
QFile file(specificSettings.fileName());
QVERIFY(file.open(QIODevice::ReadOnly));
QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text));
currentSpecificSettingsContent = file.readAll();
file.close();
}
Expand Down

0 comments on commit fff6977

Please sign in to comment.