<table><tr><td style="">ahmadsamir created this revision.<br />ahmadsamir added reviewers: Frameworks, mpyne.<br />Herald added a project: Frameworks.<br />ahmadsamir requested review of this revision.
</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/D25767">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>In KAutoSaveFilePrivate::tempFile() the name of the kautosavefile that's<br />
going to be created is generated using the filename and the absolute path<br />
and some other bits (e.g. a string generated using KRandom). The problem<br />
with that approach is that sometimes really long filenames can get created.<br />
This unit test ensures that the checks in tempFile() work correctly and<br />
generate filenames that don't exceed NAME_MAX (255 bytes/chars for Linux),<br />
otherwise the files can't be opened.</p>
<p>Depends on <a href="https://phabricator.kde.org/D24489" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">D24489</a></p>
<p>References:<br />
/usr/include/linux/limits.h<br />
<a href="https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html" class="remarkup-link" target="_blank" rel="noreferrer">https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html</a><br />
<a href="https://www.kernel.org/doc/Documentation/filesystems/path-lookup.rst" class="remarkup-link" target="_blank" rel="noreferrer">https://www.kernel.org/doc/Documentation/filesystems/path-lookup.rst</a></p></div></div><br /><div><strong>TEST PLAN</strong><div><ul class="remarkup-list">
<li class="remarkup-list-item">Running <tt style="background: #ebebeb; font-size: 13px;">ctest -R autosavefiletest</tt> fails with current master</li>
<li class="remarkup-list-item">Apply the patch from <a href="https://phabricator.kde.org/D24489" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">D24489</a>, and the test should pass</li>
</ul></div></div><br /><div><strong>REPOSITORY</strong><div><div>R244 KCoreAddons</div></div></div><br /><div><strong>BRANCH</strong><div><div>l-kautosave-unittest (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D25767">https://phabricator.kde.org/D25767</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/kautosavefiletest.cpp<br />
autotests/kautosavefiletest.h</div></div></div><br /><div><strong>To: </strong>ahmadsamir, Frameworks, mpyne<br /><strong>Cc: </strong>dfaure, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns<br /></div>