/*
- * 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 <glog/logging.h>
#include <gflags/gflags.h>
-#include "folly/ConcurrentSkipList.h"
-#include "folly/Foreach.h"
-#include "folly/String.h"
-#include "gtest/gtest.h"
+#include <folly/ConcurrentSkipList.h>
+#include <folly/Foreach.h>
+#include <folly/String.h>
+#include <gtest/gtest.h>
DEFINE_int32(num_threads, 12, "num concurrent threads to test");
LOG(INFO) << "nodetype size=" << sizeof(SkipListNodeType);
auto skipList(SkipListType::create(kHeadHeight));
- EXPECT_TRUE(skipList.first() == NULL);
- EXPECT_TRUE(skipList.last() == NULL);
+ EXPECT_TRUE(skipList.first() == nullptr);
+ EXPECT_TRUE(skipList.last() == nullptr);
skipList.add(3);
EXPECT_TRUE(skipList.contains(3));
TEST(ConcurrentSkipList, TestStringType) {
typedef folly::ConcurrentSkipList<std::string> SkipListT;
- boost::shared_ptr<SkipListT> skip = SkipListT::createInstance();
+ std::shared_ptr<SkipListT> skip = SkipListT::createInstance();
SkipListT::Accessor accessor(skip);
{
for (int i = 0; i < 100000; i++) {
<< ": could only create " << threads.size() << " threads out of "
<< numThreads;
}
- for (int i = 0; i < threads.size(); ++i) {
+ for (size_t i = 0; i < threads.size(); ++i) {
threads[i].join();
}
int main(int argc, char* argv[]) {
testing::InitGoogleTest(&argc, argv);
google::InitGoogleLogging(argv[0]);
- google::ParseCommandLineFlags(&argc, &argv, true);
+ gflags::ParseCommandLineFlags(&argc, &argv, true);
return RUN_ALL_TESTS();
}