X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Ftest%2FRangeTest.cpp;h=f9ffda970cda2588e5dd411fca9f50f45ed60980;hb=e56b41ec1f70bbafd76ea1e43c7183ad3b10daff;hp=02568dbcd8a22bc030c83789d6d1e0391d84c4f3;hpb=0b028d4ae1effbaf275b99d6bf0608429d9d4434;p=folly.git diff --git a/folly/test/RangeTest.cpp b/folly/test/RangeTest.cpp index 02568dbc..f9ffda97 100644 --- a/folly/test/RangeTest.cpp +++ b/folly/test/RangeTest.cpp @@ -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. @@ -31,17 +31,6 @@ #include #include -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 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)); }