mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 01:08:27 +00:00
Changed to use more c++11 features.
This commit is contained in:
parent
260edbf881
commit
9c7cd1af71
2 changed files with 20 additions and 30 deletions
22
test/test.cc
22
test/test.cc
|
@ -71,38 +71,28 @@ TEST(SocketTest, OpenClose)
|
|||
|
||||
TEST(GetHeaderValueTest, DefaultValue)
|
||||
{
|
||||
//MultiMap map = {{"Dummy","Dummy"}};
|
||||
MultiMap map;
|
||||
map.insert(make_pair("Dummy", "Dummy"));
|
||||
auto val = detail::get_header_value_text(map, "Content-Type", "text/plain");
|
||||
MultiMap map = {{"Dummy","Dummy"}};
|
||||
auto val = detail::get_header_value(map, "Content-Type", "text/plain");
|
||||
ASSERT_STREQ("text/plain", val);
|
||||
}
|
||||
|
||||
TEST(GetHeaderValueTest, DefaultValueInt)
|
||||
{
|
||||
//MultiMap map = {{"Dummy","Dummy"}};
|
||||
MultiMap map;
|
||||
map.insert(make_pair("Dummy", "Dummy"));
|
||||
MultiMap map = {{"Dummy","Dummy"}};
|
||||
auto val = detail::get_header_value_int(map, "Content-Length", 100);
|
||||
EXPECT_EQ(100, val);
|
||||
}
|
||||
|
||||
TEST(GetHeaderValueTest, RegularValue)
|
||||
{
|
||||
//MultiMap map = {{"Content-Type", "text/html"}, {"Dummy", "Dummy"}};
|
||||
MultiMap map;
|
||||
map.insert(make_pair("Content-Type","text/html"));
|
||||
map.insert(make_pair("Dummy", "Dummy"));
|
||||
auto val = detail::get_header_value_text(map, "Content-Type", "text/plain");
|
||||
MultiMap map = {{"Content-Type", "text/html"}, {"Dummy", "Dummy"}};
|
||||
auto val = detail::get_header_value(map, "Content-Type", "text/plain");
|
||||
ASSERT_STREQ("text/html", val);
|
||||
}
|
||||
|
||||
TEST(GetHeaderValueTest, RegularValueInt)
|
||||
{
|
||||
//MultiMap map = {{"Content-Length", "100"}, {"Dummy", "Dummy"}};
|
||||
MultiMap map;
|
||||
map.insert(make_pair("Content-Length", "100"));
|
||||
map.insert(make_pair("Dummy", "Dummy"));
|
||||
MultiMap map = {{"Content-Length", "100"}, {"Dummy", "Dummy"}};
|
||||
auto val = detail::get_header_value_int(map, "Content-Length", 0);
|
||||
EXPECT_EQ(100, val);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue