diff --git a/build.zig b/build.zig index c3b4020..86d17b8 100644 --- a/build.zig +++ b/build.zig @@ -125,9 +125,6 @@ pub fn build(b: *std.Build) void { "test/spawn_exit.cpp", "test/tests.cpp", "test/timeout_test.cpp", - "test/unx_c_api.cpp", - "test/tcp_c_api.cpp", - "test/socket_c_api.cpp", }, .flags = &cppflags }); tests.linkLibrary(lib); tests.linkLibrary(asio_dep.artifact("asio")); diff --git a/test/socket_c_api.cpp b/test/socket_c_api.cpp deleted file mode 100644 index ecd9570..0000000 --- a/test/socket_c_api.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "tests.hpp" -#include - -using namespace thespian; - -// simple smoke test of socket C API: create + destroy handles - -auto socket_c_api(thespian::context &ctx, bool &result, thespian::env_t env) - -> thespian::result { - (void)ctx; - (void)env; - - // socket requires a valid file descriptor; we can't really test much - // without one. Just test that the API is accessible (no linking errors). - // actual socket operations would need a real FD from a socket/pipe/etc. - - result = true; - return ok(); -} diff --git a/test/tcp_c_api.cpp b/test/tcp_c_api.cpp deleted file mode 100644 index ad54910..0000000 --- a/test/tcp_c_api.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "tests.hpp" -#include -#include - -using namespace thespian; - -// simple smoke test of tcp C API: create + destroy handles and listen on any -// port - -auto tcp_c_api(thespian::context &ctx, bool &result, thespian::env_t env) - -> thespian::result { - (void)ctx; - (void)env; - - struct thespian_tcp_acceptor_handle *a = thespian_tcp_acceptor_create("tag"); - if (a != nullptr) { - uint16_t port = thespian_tcp_acceptor_listen(a, in6addr_any, 0); - // port may be zero if something went wrong; ignore for smoke. - (void)port; - thespian_tcp_acceptor_close(a); - thespian_tcp_acceptor_destroy(a); - } - - struct thespian_tcp_connector_handle *c = - thespian_tcp_connector_create("tag"); - if (c != nullptr) { - // don't attempt to connect, simply exercise create/destroy - thespian_tcp_connector_destroy(c); - } - - result = true; - return ok(); -} diff --git a/test/tests.cpp b/test/tests.cpp index 6b93cfc..aba9ea0 100644 --- a/test/tests.cpp +++ b/test/tests.cpp @@ -111,9 +111,6 @@ extern "C" auto runtestcase(const char *name) -> int { tests["perf_spawn"] = perf_spawn; tests["spawn_exit"] = spawn_exit; tests["timeout_test"] = timeout_test; - tests["unx_c_api"] = unx_c_api; - tests["tcp_c_api"] = tcp_c_api; - tests["socket_c_api"] = socket_c_api; env_t env{}; env_t log_env{}; diff --git a/test/tests.hpp b/test/tests.hpp index 8e8128d..4cf3e4b 100644 --- a/test/tests.hpp +++ b/test/tests.hpp @@ -27,6 +27,3 @@ testcase perf_ring; testcase perf_spawn; testcase spawn_exit; testcase timeout_test; -testcase unx_c_api; -testcase tcp_c_api; -testcase socket_c_api; diff --git a/test/tests_cpp.zig b/test/tests_cpp.zig index 8b24081..7c17268 100644 --- a/test/tests_cpp.zig +++ b/test/tests_cpp.zig @@ -67,12 +67,3 @@ test "timeout_test" { try testcase("timeout_test"); } -test "unx_c_api" { - try testcase("unx_c_api"); -} -test "tcp_c_api" { - try testcase("tcp_c_api"); -} -test "socket_c_api" { - try testcase("socket_c_api"); -} diff --git a/test/unx_c_api.cpp b/test/unx_c_api.cpp deleted file mode 100644 index 093ddad..0000000 --- a/test/unx_c_api.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "tests.hpp" -#include - -using namespace thespian; - -// Very small smoke test for the new C API. We don't actually open sockets, -// just verify that the create/destroy functions work and return non-null. - -auto unx_c_api(thespian::context &ctx, bool &result, thespian::env_t env) - -> thespian::result { - (void)ctx; - (void)env; - - struct thespian_unx_acceptor_handle *a = thespian_unx_acceptor_create("tag"); - if (a != nullptr) { - thespian_unx_acceptor_destroy(a); - } - - struct thespian_unx_connector_handle *c = - thespian_unx_connector_create("tag"); - if (c != nullptr) { - thespian_unx_connector_destroy(c); - } - - result = true; - return ok(); -}