mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 06:01:33 -06:00
Fix wrong behavior when reading text
Also add another 'file read error' status. Closes #19254. PR #19262.
This commit is contained in:
@@ -77,6 +77,13 @@ private slots:
|
||||
QCOMPARE(readResult.value(), size10Data);
|
||||
}
|
||||
|
||||
{
|
||||
const Path crlfFile = testFolder / Path(u"crlf.txt"_s);
|
||||
const auto readResult = Utils::IO::readFile(crlfFile, -1, QIODevice::Text);
|
||||
QCOMPARE(readResult.has_value(), true);
|
||||
QCOMPARE(readResult.value(), "\n\n");
|
||||
}
|
||||
|
||||
{
|
||||
const Path nonExistFile = testFolder / Path(u".non_existent_file_1234"_s);
|
||||
const auto readResult = Utils::IO::readFile(nonExistFile, 1);
|
||||
|
||||
Reference in New Issue
Block a user