From 927cd268aac8e1a97a127f63b9dd83e831c8b642 Mon Sep 17 00:00:00 2001 From: Shantanu Tushar Date: Fri, 16 Oct 2020 17:09:44 +0200 Subject: 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 --- tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/auto/corelib') 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)); -- cgit v1.2.3