Don't throw in the Watchdog destructor
[folly.git] / folly / test / FBVectorTest.cpp
index ef3c69183b6d3f67bf5712feb0ccc9240a94035a..33a164a004efe0379dd05ef1c78f570c7556c8c4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,8 +23,6 @@
 #include <folly/FBString.h>
 #include <folly/FBVector.h>
 
-#include <gflags/gflags.h>
-
 #include <gtest/gtest.h>
 #include <list>
 #include <map>
 using namespace std;
 using namespace folly;
 
+namespace {
+
 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) {
@@ -56,31 +54,17 @@ void randomString(String* toFill, unsigned int maxSize = 1000) {
 }
 
 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()));
 }
 
-std::list<char> RandomList(unsigned int maxSize) {
-  std::list<char> lst(random(0u, maxSize));
-  std::list<char>::iterator i = lst.begin();
-  for (; i != lst.end(); ++i) {
-    *i = random('a', 'z');
-  }
-  return lst;
-}
-
 template<class T> T randomObject();
 
 template<> int randomObject<int>() {
   return random(0, 1024);
 }
-
-template<> folly::fbstring randomObject<folly::fbstring>() {
-  folly::fbstring result;
-  randomString(&result);
-  return result;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -284,9 +268,3 @@ TEST(FBVector, shrink_to_fit_after_clear) {
   EXPECT_EQ(fb1.size(), 0);
   EXPECT_EQ(fb1.capacity(), 0);
 }
-
-int main(int argc, char** argv) {
-  testing::InitGoogleTest(&argc, argv);
-  gflags::ParseCommandLineFlags(&argc, &argv, true);
-  return RUN_ALL_TESTS();
-}