[Libreoffice-commits] core.git: sfx2/qa

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Mon May 13 04:09:05 UTC 2019


 sfx2/qa/cppunit/test_misc.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit ce76026231d9536d2025a1e69f435bcbf39fe4f8
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Sat May 11 18:49:54 2019 +0000
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Mon May 13 06:08:29 2019 +0200

    Handle *link return value in sfx2 test
    
    Change-Id: I63008858558312b5fb7378249c56fbc3729c9a19
    Reviewed-on: https://gerrit.libreoffice.org/72180
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index 7022641db583..13f5a68128fa 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -161,7 +161,8 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testHardLinks)
     OString aOld = aTargetPath.toUtf8();
     aTargetPath += ".2";
     OString aNew = aTargetPath.toUtf8();
-    link(aOld.getStr(), aNew.getStr());
+    int nRet = link(aOld.getStr(), aNew.getStr());
+    CPPUNIT_ASSERT_EQUAL(0, nRet);
 
     uno::Reference<lang::XComponent> xComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument");
     CPPUNIT_ASSERT(xComponent.is());
@@ -171,7 +172,7 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testHardLinks)
 
     struct stat buf;
     // coverity[fs_check_call] - this is legitimate in the context of this text
-    int nRet = stat(aOld.getStr(), &buf);
+    nRet = stat(aOld.getStr(), &buf);
     CPPUNIT_ASSERT_EQUAL(0, nRet);
     // This failed: hard link count was 1, the hard link broke on store.
     CPPUNIT_ASSERT(buf.st_nlink > 1);
@@ -179,7 +180,8 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testHardLinks)
     // Test that symlinks are preserved as well.
     nRet = remove(aNew.getStr());
     CPPUNIT_ASSERT_EQUAL(0, nRet);
-    symlink(aOld.getStr(), aNew.getStr());
+    nRet = symlink(aOld.getStr(), aNew.getStr());
+    CPPUNIT_ASSERT_EQUAL(0, nRet);
     xStorable->storeToURL(aURL + ".2", {});
     nRet = lstat(aNew.getStr(), &buf);
     CPPUNIT_ASSERT_EQUAL(0, nRet);


More information about the Libreoffice-commits mailing list