Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[tests] Fix compilation error in test/storage/headers.cpp
Browse files Browse the repository at this point in the history
error: converting ‘false’ to pointer type for argument 1 of ‘char
testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’
[-Werror=conversion-null]
  • Loading branch information
brunoabinader committed Feb 16, 2016
1 parent 1efc299 commit 44ec2ad
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions test/storage/headers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,62 +10,62 @@ TEST_F(Storage, HTTPHeaderParsing) {

cc = http::CacheControl::parse(R"#()#");
ASSERT_FALSE(bool(cc.maxAge));
EXPECT_EQ(false, cc.mustRevalidate);
EXPECT_FALSE(cc.mustRevalidate);

cc = http::CacheControl::parse(R"#(max-age =34)#");
ASSERT_TRUE(bool(cc.maxAge));
EXPECT_EQ(34, *cc.maxAge);
EXPECT_EQ(false, cc.mustRevalidate);
EXPECT_FALSE(cc.mustRevalidate);

cc = http::CacheControl::parse(R"#(,max-age=1)#");
ASSERT_TRUE(bool(cc.maxAge));
EXPECT_EQ(1, *cc.maxAge);
EXPECT_EQ(false, cc.mustRevalidate);
EXPECT_FALSE(cc.mustRevalidate);

cc = http::CacheControl::parse(R"#(max-age=-1)#");
ASSERT_FALSE(bool(cc.maxAge));
EXPECT_EQ(false, cc.mustRevalidate);
EXPECT_FALSE(cc.mustRevalidate);

cc = http::CacheControl::parse(R"#(max-age=foo)#");
ASSERT_FALSE(bool(cc.maxAge));
EXPECT_EQ(false, cc.mustRevalidate);
EXPECT_FALSE(cc.mustRevalidate);

cc = http::CacheControl::parse(R"#(max-age="34,max-age="22,max-age=28)#");
ASSERT_TRUE(bool(cc.maxAge));
EXPECT_EQ(28, *cc.maxAge);
EXPECT_EQ(false, cc.mustRevalidate);
EXPECT_FALSE(cc.mustRevalidate);

cc = http::CacheControl::parse(R"#(max-age=3,max-age="34)#");
ASSERT_TRUE(bool(cc.maxAge));
EXPECT_EQ(3, *cc.maxAge);
EXPECT_EQ(false, cc.mustRevalidate);
EXPECT_FALSE(cc.mustRevalidate);

cc = http::CacheControl::parse(R"#(max-age="\",max-age=4,")#");
ASSERT_FALSE(bool(cc.maxAge));
EXPECT_EQ(false, cc.mustRevalidate);
EXPECT_FALSE(cc.mustRevalidate);

cc = http::CacheControl::parse(R"#(private, max-age=0, no-cache)#");
ASSERT_TRUE(bool(cc.maxAge));
EXPECT_EQ(0, *cc.maxAge);
EXPECT_EQ(false, cc.mustRevalidate);
EXPECT_FALSE(cc.mustRevalidate);

cc = http::CacheControl::parse(R"#(max-age=0, no-cache, no-store)#");
ASSERT_TRUE(bool(cc.maxAge));
EXPECT_EQ(0, *cc.maxAge);
EXPECT_EQ(false, cc.mustRevalidate);
EXPECT_FALSE(cc.mustRevalidate);

cc = http::CacheControl::parse(R"#(, private , max-bar=3 , no-cache, "\,",,foo=",",,max-age=32)#");
ASSERT_TRUE(bool(cc.maxAge));
EXPECT_EQ(32, *cc.maxAge);
EXPECT_EQ(false, cc.mustRevalidate);
EXPECT_FALSE(cc.mustRevalidate);

cc = http::CacheControl::parse(R"#(max-age=3600, must-revalidate)#");
ASSERT_TRUE(bool(cc.maxAge));
EXPECT_EQ(3600, *cc.maxAge);
EXPECT_EQ(true, cc.mustRevalidate);
EXPECT_TRUE(cc.mustRevalidate);

cc = http::CacheControl::parse(R"#(no-cache="Expires,Via",max-age=3600, must-revalidate)#");
ASSERT_TRUE(bool(cc.maxAge));
EXPECT_EQ(3600, *cc.maxAge);
EXPECT_EQ(true, cc.mustRevalidate);
EXPECT_TRUE(cc.mustRevalidate);
}

0 comments on commit 44ec2ad

Please sign in to comment.