diff options
author | Shantanu Tushar <shantanu.tushar@kdab.com> | 2020-10-16 17:09:44 +0200 |
---|---|---|
committer | Shantanu Tushar <shantanu.tushar@kdab.com> | 2020-10-18 20:16:38 +0200 |
commit | 927cd268aac8e1a97a127f63b9dd83e831c8b642 (patch) | |
tree | 1f146319bf12d4ca462e953c82e79ea27d0d45b7 /tests/auto/corelib/io/qlockfile | |
parent | 9402a351dd1f37d595660010c7a55a7c8fb5e668 (diff) |
Add function to access QLockFile's file name
This is useful in cases like error handling when you need to print the
name of the lock file.
Change-Id: Ife4901ed53ae81d19e68cce7f1c173ef3745d56f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/io/qlockfile')
-rw-r--r-- | tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp index 708716e7e2..54d2182e5c 100644 --- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp +++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp @@ -96,6 +96,7 @@ void tst_QLockFile::lockUnlock() const QString fileName = dir.path() + "/lock1"; QVERIFY(!QFile(fileName).exists()); QLockFile lockFile(fileName); + QCOMPARE(lockFile.fileName(), fileName); QVERIFY(lockFile.lock()); QVERIFY(lockFile.isLocked()); QCOMPARE(int(lockFile.error()), int(QLockFile::NoError)); |