Print the co_gns_server_create failure reason in the bridge test

The bare assert hid why server creation fails on the CI runner. Emit the
error buffer to stderr before asserting so the cause is visible in logs.
This commit is contained in:
NomadsReach
2026-08-16 17:51:49 -04:00
parent f1a7876770
commit 6861fa4276
@@ -6,6 +6,7 @@
#include <cassert> #include <cassert>
#include <chrono> #include <chrono>
#include <cstdint> #include <cstdint>
#include <cstdio>
#include <optional> #include <optional>
#include <string> #include <string>
#include <thread> #include <thread>
@@ -129,7 +130,11 @@ int main()
{ {
co_gns_server_handle server = nullptr; co_gns_server_handle server = nullptr;
std::array<char, 256> error{}; std::array<char, 256> error{};
assert(co_gns_server_create("127.0.0.1", 0, &server, error.data(), error.size()) == 1); const int createResult = co_gns_server_create("127.0.0.1", 0, &server, error.data(), error.size());
if (createResult != 1) {
std::fprintf(stderr, "co_gns_server_create failed (rc=%d): %s\n", createResult, error.data());
}
assert(createResult == 1);
assert(server != nullptr); assert(server != nullptr);
const auto port = co_gns_server_local_port(server); const auto port = co_gns_server_local_port(server);
assert(port != 0); assert(port != 0);