Michael Vogt 12 lat temu
rodzic
commit
a111a024a3
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      test/libapt/fileutl_test.cc

+ 4 - 0
test/libapt/fileutl_test.cc

@@ -226,8 +226,12 @@ TEST(FileUtlTest, GetTempDir)
 }
 }
 TEST(FileUtlTest, flAbsPath)
 TEST(FileUtlTest, flAbsPath)
 {
 {
+   std::string cwd = SafeGetCWD();
    int res = chdir("/bin/");
    int res = chdir("/bin/");
    EXPECT_EQ(res, 0);
    EXPECT_EQ(res, 0);
    std::string p = flAbsPath("ls");
    std::string p = flAbsPath("ls");
    EXPECT_EQ(p, "/bin/ls");
    EXPECT_EQ(p, "/bin/ls");
+
+   res = chdir(cwd.c_str());
+   EXPECT_EQ(res, 0);
 }
 }