-
Notifications
You must be signed in to change notification settings - Fork 387
Fix http linking and enable http test #2353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,7 +88,7 @@ void Service::ready() | |
| printf("Error: %s \n", err.to_string().c_str()); | ||
|
|
||
| CHECKSERT(!err, "No error"); | ||
| printf("Received body: %s\n", res->body()); | ||
| printf("Received body: %.*s\n", static_cast<int>(res->body().length()), res->body().data()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not using the opportunity to replace printf-specifiers with
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Damn pirkete.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would that look like?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this specific case, I see that In C++23, we'd be able to In C++20, you can either std::cout << std::body() << std::endl;
// or if you want to use printf
auto s = std::format("{}", res->body());
printf("%s\n", s.cstr());It's worth noting that if namespace http {
inline std::string format_as(const http::ResponseBody& body) {
return body.toString();
}
}For C++20, this requires building a template for
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, for completeness sake, in case you actually need to specify the length: size_t len = body.length();
char *s = body.data(); // this loses the size() knowledge
std::cout << std::format("{:{}}\n", s, len); |
||
| CHECKSERT(res->body() == "/testing", "Received body: \"/testing\""); | ||
|
|
||
| printf("SUCCESS\n"); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -238,7 +238,6 @@ exclusions=( | |
| "dhcpd" # Times out, requires certain routes to be set up. Seems easy. | ||
| "dhcpd_dhclient_linux" # We can't run userspace tests with this setup yet. | ||
| "gateway" # Requires NaCl which is currently not integrated | ||
| "http" # Linking fails, undefined ref to http_parser_parse_url, http_parser_execute | ||
| "microLB" # Missing dependencies: microLB, diskbuilder, os_add_os_library | ||
| "nat" # Times out after 3 / 6 tests seem to pass. Might be a legit bug here. | ||
| "router" # Times out, requies sudo and has complex network setup. | ||
|
|
@@ -258,6 +257,7 @@ unsandbox_list=( | |
| "${INTEGRATION_TESTS}/net/tcp" | ||
| "${INTEGRATION_TESTS}/net/udp" | ||
| "${INTEGRATION_TESTS}/net/dns" # except this one which times out instead | ||
| "${INTEGRATION_TESTS}/net/http" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! |
||
| ) | ||
| run_testsuite "${INTEGRATION_TESTS}/net" "${exclusions[@]}" | ||
| unsandbox_list=() | ||
|
|
||
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.
Yippie!