ahmadsamir created this revision. ahmadsamir added reviewers: Frameworks, mpyne. Herald added a project: Frameworks. ahmadsamir requested review of this revision.
REVISION SUMMARY In KAutoSaveFilePrivate::tempFile() the name of the kautosavefile that's going to be created is generated using the filename and the absolute path and some other bits (e.g. a string generated using KRandom). The problem with that approach is that sometimes really long filenames can get created. This unit test ensures that the checks in tempFile() work correctly and generate filenames that don't exceed NAME_MAX (255 bytes/chars for Linux), otherwise the files can't be opened. Depends on D24489 <https://phabricator.kde.org/D24489> References: /usr/include/linux/limits.h https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html https://www.kernel.org/doc/Documentation/filesystems/path-lookup.rst TEST PLAN - Running `ctest -R autosavefiletest` fails with current master - Apply the patch from D24489 <https://phabricator.kde.org/D24489>, and the test should pass REPOSITORY R244 KCoreAddons BRANCH l-kautosave-unittest (branched from master) REVISION DETAIL https://phabricator.kde.org/D25767 AFFECTED FILES autotests/kautosavefiletest.cpp autotests/kautosavefiletest.h To: ahmadsamir, #frameworks, mpyne Cc: dfaure, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns