Tidy up HTTP reason_string (API Change):

fix #182

reason_string() is now located in <beast/http/message.hpp>
and returns a string view rather than char const*.
This commit is contained in:
Vinnie Falco
2017-05-09 07:23:10 -07:00
parent 2bf515069d
commit 5631936106
10 changed files with 80 additions and 94 deletions
-1
View File
@@ -57,7 +57,6 @@ unit-test http-tests :
http/message.cpp
http/message_parser.cpp
http/read.cpp
http/reason.cpp
http/rfc7230.cpp
http/string_body.cpp
http/write.cpp
-1
View File
@@ -20,7 +20,6 @@ add_executable (http-tests
message.cpp
message_parser.cpp
read.cpp
reason.cpp
rfc7230.cpp
string_body.cpp
write.cpp
+8
View File
@@ -296,6 +296,13 @@ public:
}();
}
void
testReasonString()
{
for(int i = 1; i <= 999; ++i)
BEAST_EXPECT(! reason_string(i).empty());
}
void
run() override
{
@@ -305,6 +312,7 @@ public:
testPrepare();
testSwap();
testSpecialMembers();
testReasonString();
}
};
-29
View File
@@ -1,29 +0,0 @@
//
// Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Test that header file is self-contained.
#include <beast/http/reason.hpp>
#include <beast/unit_test/suite.hpp>
namespace beast {
namespace http {
class reason_test : public unit_test::suite
{
public:
void run() override
{
for(int i = 1; i <= 999; ++i)
BEAST_EXPECT(reason_string(i) != nullptr);
}
};
BEAST_DEFINE_TESTSUITE(reason,http,beast);
} // http
} // beast