-
Notifications
You must be signed in to change notification settings - Fork 3
Improve coverage #19
Improve coverage #19
Conversation
Codecov Report
@@ Coverage Diff @@
## feature/socket #19 +/- ##
==================================================
+ Coverage 79.88% 85.53% +5.65%
==================================================
Files 11 12 +1
Lines 835 1051 +216
Branches 82 94 +12
==================================================
+ Hits 667 899 +232
+ Misses 168 152 -16
Continue to review full report at Codecov.
|
examples/socket_unix_udp_client.cpp
Outdated
std::string serverPath("/tmp/unixServer"); | ||
|
||
unixClient.bind([&](AddrUnix &s) { | ||
return methods::construct(s, &clientPath.front()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not .c_str()
?
examples/socket_unix_udp_client.cpp
Outdated
return methods::construct(s, &clientPath.front()); | ||
}); | ||
|
||
unixClient.connect(&serverPath.front()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.c_str()
?
examples/socket_unix_udp_server.cpp
Outdated
std::string serverPath("/tmp/unixServer"); | ||
|
||
unixServer.bind([&](AddrUnix &s) { | ||
return methods::construct(s, &serverPath.front()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.c_str()
?
test/socket_connect_test.cpp
Outdated
std::thread serverThread1(runUnixServer, std::ref(serverUnixTCP), | ||
&unixPathServer.front()); | ||
serverThread1.detach(); | ||
std::this_thread::sleep_for(2s); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try lowering 2s
delay if possible.
EXPECT_ANY_THROW(Socket s(Domain::IPv4, Type::TCP, 41)); | ||
EXPECT_ANY_THROW(Socket s(Domain::IPv4, Type::UDP, 6)); | ||
|
||
EXPECT_NO_THROW(Socket otherS(Socket(Domain::IPv4, Type::TCP))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trying the constructor which takes an rvalue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tkhurana96 try with a vector.emplace()
kind of method then, which is more practical example.
void udpIPv6ServerProcessing(Socket &serverSocket) | ||
{ | ||
const auto res = serverSocket.read(readTest::msgLen); | ||
EXPECT_EQ(res, readTest::msg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why using EXPECT_EQ
?
test/socket_read_write_test.cpp
Outdated
Socket unixClient1(Domain::UNIX, Type::TCP); | ||
EXPECT_EQ(unixClient1.getType(), Type::TCP); | ||
EXPECT_NO_THROW(unixClient1.bind([&](AddrUnix &s) { | ||
return methods::construct(s, &readTest::unixClientPath1.front()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.c.str()
?
test/socket_read_write_test.cpp
Outdated
EXPECT_NO_THROW(unixClient1.bind([&](AddrUnix &s) { | ||
return methods::construct(s, &readTest::unixClientPath1.front()); | ||
})); | ||
EXPECT_NO_THROW(unixClient1.connect(&readTest::unixServerPath1.front())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.c.str()
?
test/socket_read_write_test.cpp
Outdated
Socket unixClient2(Domain::UNIX, Type::UDP); | ||
EXPECT_EQ(unixClient2.getType(), Type::UDP); | ||
EXPECT_NO_THROW(unixClient2.bind([&](AddrUnix &s) { | ||
return methods::construct(s, &readTest::unixClientPath2.front()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.c.str()
?
test/socket_read_write_test.cpp
Outdated
EXPECT_NO_THROW(unixClient2.bind([&](AddrUnix &s) { | ||
return methods::construct(s, &readTest::unixClientPath2.front()); | ||
})); | ||
EXPECT_NO_THROW(unixClient2.connect(&readTest::unixServerPath2.front())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.c.str()
?
No description provided.