Split get_default() into two for deferred default construction
[folly.git] / folly / test / FileLockTest.cpp
index 595c28c142b726c807701d374ca9c496b2f13cc1..85e5409ccef8200e6afd3eabfc879e715b673521 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 #include <folly/File.h>
 
+#include <mutex>
+
 #include <boost/thread/locks.hpp>
+#include <glog/logging.h>
 
 #include <folly/String.h>
 #include <folly/Subprocess.h>
-#include <folly/experimental/io/FsUtil.h>
 #include <folly/experimental/TestUtil.h>
-
-#include <gflags/gflags.h>
-#include <glog/logging.h>
-#include <gtest/gtest.h>
-
-#include <mutex>
+#include <folly/experimental/io/FsUtil.h>
+#include <folly/portability/GFlags.h>
+#include <folly/portability/GTest.h>
 
 using namespace folly;
 using namespace folly::test;
@@ -43,7 +42,7 @@ TEST(File, Locks) {
   static constexpr size_t pathLength = 2048;
   char buf[pathLength + 1];
   int r = readlink("/proc/self/exe", buf, pathLength);
-  CHECK_ERR(r);
+  CHECK(r != -1);
   buf[r] = '\0';
 
   fs::path me(buf);
@@ -61,9 +60,9 @@ TEST(File, Locks) {
 
   enum LockMode { EXCLUSIVE, SHARED };
   auto testLock = [&](LockMode mode, bool expectedSuccess) {
-    auto ret = Subprocess({helper.native(),
+    auto ret = Subprocess({helper.string(),
                            mode == SHARED ? "-s" : "-x",
-                           tempFile.path().native()}).wait();
+                           tempFile.path().string()}).wait();
     EXPECT_TRUE(ret.exited());
     if (ret.exited()) {
       EXPECT_EQ(expectedSuccess ? 0 : 42, ret.exitStatus());