Style nits for folly/test/FingerprintBenchmark.cpp
[folly.git] / folly / test / RangeTest.cpp
index 02568dbcd8a22bc030c83789d6d1e0391d84c4f3..f9ffda970cda2588e5dd411fca9f50f45ed60980 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 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 <boost/range/concepts.hpp>
 #include <gtest/gtest.h>
 
-namespace folly { namespace detail {
-
-// declaration of functions in Range.cpp
-size_t qfind_first_byte_of_memchr(const StringPiece haystack,
-                                  const StringPiece needles);
-
-size_t qfind_first_byte_of_byteset(const StringPiece haystack,
-                                   const StringPiece needles);
-
-}}  // namespaces
-
 using namespace folly;
 using namespace std;
 
@@ -301,7 +290,6 @@ TEST(StringPiece, InvalidRange) {
   EXPECT_THROW(a.subpiece(6), std::out_of_range);
 }
 
-#if FOLLY_HAVE_CONSTEXPR_STRLEN
 constexpr char helloArray[] = "hello";
 
 TEST(StringPiece, Constexpr) {
@@ -311,7 +299,6 @@ TEST(StringPiece, Constexpr) {
   constexpr StringPiece hello2(helloArray);
   EXPECT_EQ("hello", hello2);
 }
-#endif
 
 TEST(StringPiece, Prefix) {
   StringPiece a("hello");
@@ -850,19 +837,14 @@ struct NoSseNeedleFinder {
   }
 };
 
-struct MemchrNeedleFinder {
-  static size_t find_first_byte_of(StringPiece haystack, StringPiece needles) {
-    return detail::qfind_first_byte_of_memchr(haystack, needles);
-  }
-};
-
 struct ByteSetNeedleFinder {
   static size_t find_first_byte_of(StringPiece haystack, StringPiece needles) {
     return detail::qfind_first_byte_of_byteset(haystack, needles);
   }
 };
 
-typedef ::testing::Types<SseNeedleFinder, NoSseNeedleFinder, MemchrNeedleFinder,
+typedef ::testing::Types<SseNeedleFinder,
+                         NoSseNeedleFinder,
                          ByteSetNeedleFinder> NeedleFinders;
 TYPED_TEST_CASE(NeedleFinderTest, NeedleFinders);
 
@@ -907,7 +889,7 @@ TYPED_TEST(NeedleFinderTest, Unaligned) {
   string s = "0123456789ABCDEFGH";
   for (size_t i = 0; i < s.size(); ++i) {
     StringPiece a(s.c_str() + i);
-    for (int j = 0; j < s.size(); ++j) {
+    for (size_t j = 0; j < s.size(); ++j) {
       StringPiece b(s.c_str() + j);
       EXPECT_EQ((i > j) ? 0 : j - i, this->find_first_byte_of(a, b));
     }