mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-05 20:51:25 -07:00
Fix wrong behavior when reading text
Also add another 'file read error' status. Closes #19254. PR #19262.
This commit is contained in:
parent
08a771468d
commit
80791e328d
7 changed files with 45 additions and 11 deletions
2
test/testdata/crlf.txt
vendored
Normal file
2
test/testdata/crlf.txt
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue