Add getIPv6For6To4 to IPAddressV4
[folly.git] / folly / test / RWSpinLockTest.cpp
index 745ad68f6cea17c9ae9005b9ced0892964f0e6ba..1d9e15789bb99695313a5ca90ee1182628ae809c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 Facebook, Inc.
+ * Copyright 2015 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 <vector>
 #include <thread>
 
-#include "gtest/gtest.h"
+#include <gtest/gtest.h>
 #include <gflags/gflags.h>
 #include <glog/logging.h>
-#include "folly/RWSpinLock.h"
+#include <folly/RWSpinLock.h>
 
 DEFINE_int32(num_threads, 8, "num threads");
 
@@ -41,8 +41,7 @@ template<typename RWSpinLockT> struct RWSpinLockTest: public testing::Test {
 };
 
 typedef testing::Types<RWSpinLock
-#if defined(__GNUC__) && (defined(__i386) || defined(__x86_64__) || \
-    defined(ARCH_K8))
+#ifdef RW_SPINLOCK_USE_X86_INTRINSIC_
         , RWTicketSpinLockT<32, true>,
         RWTicketSpinLockT<32, false>,
         RWTicketSpinLockT<64, true>,
@@ -149,7 +148,7 @@ TYPED_TEST(RWSpinLockTest, Write_Holders) {
 TYPED_TEST(RWSpinLockTest, ConcurrentTests) {
   typedef typename TestFixture::RWSpinLockType RWSpinLockType;
   RWSpinLockType l;
-  srand(time(NULL));
+  srand(time(nullptr));
 
   std::vector<std::thread> threads;
   for (int i = 0; i < FLAGS_num_threads; ++i) {
@@ -188,7 +187,7 @@ TEST(RWSpinLock, lock_unlock_tests) {
 }
 
 TEST(RWSpinLock, concurrent_holder_test) {
-  srand(time(NULL));
+  srand(time(nullptr));
 
   folly::RWSpinLock lock;
   std::atomic<int64_t> reads(0);
@@ -238,6 +237,6 @@ TEST(RWSpinLock, concurrent_holder_test) {
 
 int main(int argc, char** argv) {
   testing::InitGoogleTest(&argc, argv);
-  google::ParseCommandLineFlags(&argc, &argv, true);
+  gflags::ParseCommandLineFlags(&argc, &argv, true);
   return RUN_ALL_TESTS();
 }