Remove namespace in http layer
Within this namespace, we don't need to call crow, we are already in the
crow namespace.
Tested: Code compiles.
Change-Id: Ida57624ef1157f98f2719b5c3af536aebaca601e
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/test/http/http_response_test.cpp b/test/http/http_response_test.cpp
index 8277a3f..62a95a4 100644
--- a/test/http/http_response_test.cpp
+++ b/test/http/http_response_test.cpp
@@ -17,15 +17,17 @@
#include <string>
#include "gtest/gtest.h"
+namespace crow
+{
namespace
{
-void addHeaders(crow::Response& res)
+void addHeaders(Response& res)
{
res.addHeader("myheader", "myvalue");
res.keepAlive(true);
res.result(boost::beast::http::status::ok);
}
-void verifyHeaders(crow::Response& res)
+void verifyHeaders(Response& res)
{
EXPECT_EQ(res.getHeaderValue("myheader"), "myvalue");
EXPECT_EQ(res.keepAlive(), true);
@@ -68,13 +70,13 @@
TEST(HttpResponse, Headers)
{
- crow::Response res;
+ Response res;
addHeaders(res);
verifyHeaders(res);
}
TEST(HttpResponse, StringBody)
{
- crow::Response res;
+ Response res;
addHeaders(res);
std::string_view bodyValue = "this is my new body";
res.write({bodyValue.data(), bodyValue.length()});
@@ -83,7 +85,7 @@
}
TEST(HttpResponse, HttpBody)
{
- crow::Response res;
+ Response res;
addHeaders(res);
TemporaryFileHandle temporaryFile("sample text");
res.openFile(temporaryFile.stringPath);
@@ -92,7 +94,7 @@
}
TEST(HttpResponse, HttpBodyWithFd)
{
- crow::Response res;
+ Response res;
addHeaders(res);
TemporaryFileHandle temporaryFile("sample text");
FILE* fd = fopen(temporaryFile.stringPath.c_str(), "r+");
@@ -103,7 +105,7 @@
TEST(HttpResponse, Base64HttpBodyWithFd)
{
- crow::Response res;
+ Response res;
addHeaders(res);
TemporaryFileHandle temporaryFile("sample text");
FILE* fd = fopen(temporaryFile.stringPath.c_str(), "r");
@@ -115,7 +117,7 @@
TEST(HttpResponse, BodyTransitions)
{
- crow::Response res;
+ Response res;
addHeaders(res);
TemporaryFileHandle temporaryFile("sample text");
res.openFile(temporaryFile.stringPath);
@@ -138,7 +140,7 @@
TEST(HttpResponse, StringBodyWriterLarge)
{
- crow::Response res;
+ Response res;
std::string data = generateBigdata();
res.write(std::string(data));
EXPECT_EQ(getData(res.response), data);
@@ -146,7 +148,7 @@
TEST(HttpResponse, Base64HttpBodyWriter)
{
- crow::Response res;
+ Response res;
std::string data = "sample text";
TemporaryFileHandle temporaryFile(data);
FILE* f = fopen(temporaryFile.stringPath.c_str(), "r+");
@@ -156,7 +158,7 @@
TEST(HttpResponse, Base64HttpBodyWriterLarge)
{
- crow::Response res;
+ Response res;
std::string data = generateBigdata();
TemporaryFileHandle temporaryFile(data);
@@ -166,12 +168,12 @@
ec);
EXPECT_EQ(ec.value(), 0);
res.openFd(file.native_handle(), bmcweb::EncodingType::Base64);
- EXPECT_EQ(getData(res.response), crow::utility::base64encode(data));
+ EXPECT_EQ(getData(res.response), utility::base64encode(data));
}
TEST(HttpResponse, HttpBodyWriterLarge)
{
- crow::Response res;
+ Response res;
std::string data = generateBigdata();
TemporaryFileHandle temporaryFile(data);
@@ -183,5 +185,5 @@
res.openFd(file.native_handle());
EXPECT_EQ(getData(res.response), data);
}
-
} // namespace
+} // namespace crow