[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-frameworks-devel
Subject: D24489: KAutosaveFile not respecting maximum filename length
From: Ahmad Samir <noreply () phabricator ! kde ! org>
Date: 2019-12-13 18:34:31
Message-ID: 45d45adc48839beb5375a09036aafe44 () localhost ! localdomain
[Download RAW message or body]
[Attachment #2 (text/plain)]
ahmadsamir added a comment.
FWIW, this broke kautosavefiletest:
3: ********* Start testing of KAutoSaveFileTest *********
3: Config: Using QtTest library 5.13.1, Qt 5.13.1 (x86_64-little_endian-lp64 shared (dynamic) release \
build; by GCC 9.2.1 20190903 [gcc-9-branch revision 275330]) 3: PASS : \
KAutoSaveFileTest::initTestCase() 3: PASS : KAutoSaveFileTest::test_readWrite()
3: PASS : KAutoSaveFileTest::test_fileNameMaxLength()
3: PASS : KAutoSaveFileTest::test_fileStaleFiles()
3: PASS : KAutoSaveFileTest::test_applicationStaleFiles()
3: FAIL! : KAutoSaveFileTest::test_locking() '!staleFiles.isEmpty()' returned FALSE. ()
3: Loc: [/home/ahmad/rpmbuild/dev/kcoreaddons/autotests/kautosavefiletest.cpp(148)]
3: PASS : KAutoSaveFileTest::cleanupTestCase()
3: Totals: 6 passed, 1 failed, 0 skipped, 0 blacklisted, 87ms
3: ********* Finished testing of KAutoSaveFileTest *********
1/1 Test #3: kautosavefiletest ................***Failed 0.09 sec
I've tracked it down to line 201 in kautosavefile.cpp:
return QUrl::toPercentEncoding(managedFile.toLocalFile()).startsWith(encodedPath);
The test_locking(), in the unit test, is using a remote file:
QUrl normalFile(QString::fromLatin1("fish://user@example.com/home/remote/test.txt"));
so the call to managedFile.toLocalFile() returns an empty string. Using .path() instead seems to work.
REPOSITORY
R244 KCoreAddons
REVISION DETAIL
https://phabricator.kde.org/D24489
To: mardelle, #frameworks, dfaure, mpyne
Cc: ahmadsamir, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
[Attachment #3 (text/html)]
<table><tr><td style="">ahmadsamir added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; \
font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to \
bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" \
href="https://phabricator.kde.org/D24489">View Revision</a></tr></table><br /><div><div><p>FWIW, this \
broke kautosavefiletest:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" \
data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", \
"Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, \
120, 0.08);">3: ********* Start testing of KAutoSaveFileTest *********
3: Config: Using QtTest library 5.13.1, Qt 5.13.1 (x86_64-little_endian-lp64 shared (dynamic) release \
build; by GCC 9.2.1 20190903 [gcc-9-branch revision 275330])
3: PASS : KAutoSaveFileTest::initTestCase()
3: PASS : KAutoSaveFileTest::test_readWrite()
3: PASS : KAutoSaveFileTest::test_fileNameMaxLength()
3: PASS : KAutoSaveFileTest::test_fileStaleFiles()
3: PASS : KAutoSaveFileTest::test_applicationStaleFiles()
3: FAIL! : KAutoSaveFileTest::test_locking() '!staleFiles.isEmpty()' returned FALSE. ()
3: Loc: [/home/ahmad/rpmbuild/dev/kcoreaddons/autotests/kautosavefiletest.cpp(148)]
3: PASS : KAutoSaveFileTest::cleanupTestCase()
3: Totals: 6 passed, 1 failed, 0 skipped, 0 blacklisted, 87ms
3: ********* Finished testing of KAutoSaveFileTest *********
1/1 Test #3: kautosavefiletest ................***Failed 0.09 sec</pre></div>
<p>I've tracked it down to line 201 in kautosavefile.cpp:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" \
data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", \
"Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, \
120, 0.08);">return QUrl::toPercentEncoding(managedFile.toLocalFile()).startsWith(encodedPath);</pre></div>
<p>The test_locking(), in the unit test, is using a remote file:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" \
data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", \
"Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, \
120, 0.08);">QUrl normalFile(QString::fromLatin1("fish://user@example.com/home/remote/test.txt"));</pre></div>
<p>so the call to managedFile.toLocalFile() returns an empty string. Using .path() instead seems to \
work.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R244 \
KCoreAddons</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a \
href="https://phabricator.kde.org/D24489">https://phabricator.kde.org/D24489</a></div></div><br \
/><div><strong>To: </strong>mardelle, Frameworks, dfaure, mpyne<br /><strong>Cc: </strong>ahmadsamir, \
kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns<br /></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic