Formatted package
This commit is contained in:
Dhanya Thattil
2022-08-05 15:39:34 +02:00
committed by GitHub
parent 7173785b29
commit 6bf9dbf6d3
89 changed files with 1366 additions and 1210 deletions

View File

@ -38,7 +38,8 @@ int main(int argc, char **argv) {
for (int i = 0; i != 100; ++i) {
std::cout << "Sending: " << i << "\n";
auto socket = sls::ClientSocket("test", hostname, port);
std::cout << "Sent: " << socket.Send(sls::func_id::read_int) << " bytes\n";
std::cout << "Sent: " << socket.Send(sls::func_id::read_int)
<< " bytes\n";
std::cout << "Sent: " << socket.Send(i) << " bytes\n";
}
@ -46,7 +47,8 @@ int main(int argc, char **argv) {
for (int i = 0; i != 5; ++i) {
std::cout << "Sending data\n";
auto socket = sls::ClientSocket("test", hostname, port);
std::cout << "Sent: " << socket.Send(sls::func_id::read_data) << " bytes\n";
std::cout << "Sent: " << socket.Send(sls::func_id::read_data)
<< " bytes\n";
std::cout << "Sent: " << socket.Send(data.get(), sls::DATA_SIZE)
<< " bytes\n";
}
@ -54,7 +56,8 @@ int main(int argc, char **argv) {
// Send too little data
{
auto socket = sls::ClientSocket("test", hostname, port);
std::cout << "Sent: " << socket.Send(sls::func_id::read_data) << " bytes\n";
std::cout << "Sent: " << socket.Send(sls::func_id::read_data)
<< " bytes\n";
std::cout << "Sent: " << socket.Send(data.get(), sls::DATA_SIZE / 2)
<< " bytes\n";
}
@ -71,7 +74,8 @@ int main(int argc, char **argv) {
for (int i = 0; i != 10; ++i) {
std::cout << "Sending: " << i << "\n";
auto socket = sls::ClientSocket("test", hostname, port);
std::cout << "Sent: " << socket.Send(sls::func_id::read_int) << " bytes\n";
std::cout << "Sent: " << socket.Send(sls::func_id::read_int)
<< " bytes\n";
std::cout << "Sent: " << socket.Send(i) << " bytes\n";
}

View File

@ -30,13 +30,14 @@ int main(int argc, char *argv[]) {
sls::test::my_ip = "undefined";
Catch::Session session;
auto cli =
session.cli() |
sls::Opt(sls::test::hostname, "hostname")["-hn"]["--hostname"](
"Detector hostname for integration tests") |
sls::Opt(sls::test::detector_type, "detector_type")["-dt"]["--detector_type"](
"Detector type for integration tests") |
sls::Opt(sls::test::my_ip, "my_ip")["-hip"]["--host_ip"]("Host ip address");
auto cli = session.cli() |
sls::Opt(sls::test::hostname, "hostname")["-hn"]["--hostname"](
"Detector hostname for integration tests") |
sls::Opt(sls::test::detector_type,
"detector_type")["-dt"]["--detector_type"](
"Detector type for integration tests") |
sls::Opt(sls::test::my_ip,
"my_ip")["-hip"]["--host_ip"]("Host ip address");
session.cli(cli);
@ -47,8 +48,8 @@ int main(int argc, char *argv[]) {
sls::test::type = slsDetectorDefs::GENERIC;
if (!sls::test::detector_type.empty()) {
sls::test::type =
sls::StringTo<slsDetectorDefs::detectorType>(sls::test::detector_type);
sls::test::type = sls::StringTo<slsDetectorDefs::detectorType>(
sls::test::detector_type);
}
return session.run();