/*
- * Copyright 2012 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.
//
// Author: andrei.alexandrescu@fb.com
-#include "folly/Traits.h"
-#include "folly/Random.h"
-#include "folly/FBString.h"
-#include "folly/FBVector.h"
-#include "folly/Benchmark.h"
-
-#include <gflags/gflags.h>
-
-#include <gtest/gtest.h>
#include <list>
#include <memory>
+
#include <boost/random.hpp>
+#include <folly/Benchmark.h>
+#include <folly/FBString.h>
+#include <folly/FBVector.h>
+#include <folly/Foreach.h>
+#include <folly/Random.h>
+#include <folly/Traits.h>
+#include <folly/portability/GFlags.h>
+#include <folly/portability/GTest.h>
+
using namespace std;
using namespace folly;
auto static const seed = randomNumberSeed();
typedef boost::mt19937 RandomT;
static RandomT rng(seed);
-static const size_t maxString = 100;
-static const bool avoidAliasing = true;
template <class Integral1, class Integral2>
Integral2 random(Integral1 low, Integral2 up) {
}
template <class String, class Integral>
-void Num2String(String& str, Integral n) {
+void Num2String(String& str, Integral /* n */) {
str.resize(10, '\0');
sprintf(&str[0], "%ul", 10);
str.resize(strlen(str.c_str()));
return lst;
}
-template<class T> T randomObject();
+template <class T> T randomObject();
-template<> int randomObject<int>() {
+template <> int randomObject<int>() {
return random(0, 1024);
}
-template<> folly::fbstring randomObject<folly::fbstring>() {
+template <> folly::fbstring randomObject<folly::fbstring>() {
folly::fbstring result;
randomString(&result);
return result;
typedef fbvector<folly::fbstring> FBStringFBVector;
#define VECTOR IntVector
-#include "folly/test/FBVectorTestBenchmarks.cpp.h"
+#include <folly/test/FBVectorTestBenchmarks.cpp.h> // nolint
#undef VECTOR
#define VECTOR IntFBVector
-#include "folly/test/FBVectorTestBenchmarks.cpp.h"
+#include <folly/test/FBVectorTestBenchmarks.cpp.h> // nolint
#undef VECTOR
#define VECTOR FBStringVector
-#include "folly/test/FBVectorTestBenchmarks.cpp.h"
+#include <folly/test/FBVectorTestBenchmarks.cpp.h> // nolint
#undef VECTOR
#define VECTOR FBStringFBVector
-#include "folly/test/FBVectorTestBenchmarks.cpp.h"
+#include <folly/test/FBVectorTestBenchmarks.cpp.h> // nolint
#undef VECTOR
int main(int argc, char** argv) {
- google::ParseCommandLineFlags(&argc, &argv, true);
+ gflags::ParseCommandLineFlags(&argc, &argv, true);
folly::runBenchmarks();
return 0;
}