Skip to content

Commit d43fddf

Browse files
committed
Fix request_base_test
Don't use incorretly the string's substring constructor
1 parent dddc187 commit d43fddf

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

http/test/request_base_test.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ TEST(request_test, request_storage_flow) {
4242
ASSERT_EQ(bytes_read, sizeof(data));
4343
std::string flattened;
4444
simple.flatten(flattened);
45-
ASSERT_EQ(flattened, std::string(output, sizeof(data)));
46-
ASSERT_EQ(std::string(data, sizeof(data)), std::string(output, sizeof(data)));
45+
ASSERT_EQ(flattened, output);
46+
ASSERT_EQ(std::string(data, sizeof(data)), output);
4747
simple.clear();
4848
}
4949

@@ -58,9 +58,8 @@ TEST(request_test, request_storage_copy) {
5858
ASSERT_EQ(bytes_read, sizeof(quick_brown));
5959
std::string flattened;
6060
copy.flatten(flattened);
61-
ASSERT_EQ(flattened, std::string(output, sizeof(quick_brown)));
62-
ASSERT_EQ(std::string(quick_brown, sizeof(quick_brown)),
63-
std::string(output, sizeof(quick_brown)));
61+
ASSERT_EQ(flattened, output);
62+
ASSERT_EQ(std::string(quick_brown, sizeof(quick_brown)), output);
6463
copy.clear();
6564
flattened.clear();
6665
original.flatten(flattened);

0 commit comments

Comments
 (0)