+/*
+ Prep related tests. These mostly drive cases that aren't driven by "normal"
+ connect, send, receive tests (e.g. UDP branches).
+*/
+static int prep() {
+ int errors = 0;
+ void* thing; // the thing that should be returned
+
+ thing = SIlisten_prep( UDP_DEVICE, "localhost:1234", AF_INET );
+ errors += fail_if_nil( thing, "listen prep udp returned nil block" );
+
+ thing = SIlisten_prep( UDP_DEVICE, "localhost:1234", 84306 ); // this should fail
+ errors += fail_not_nil( thing, "listen prep udp returned valid block ptr for bogus family" );
+
+ thing = SIconn_prep( si_ctx, UDP_DEVICE, "localhost:1234", 84306 ); // again, expect to fail; bogus family
+ errors += fail_not_nil( thing, "conn prep udp returned valid block ptr for bogus family" );
+
+ return errors;
+}
+
+/*
+ Polling/waiting tests. These are difficult at best because of the blocking
+ nature of things, not to mention needing to have real ports open etc.
+*/
+static int poll() {
+ int errors = 0;
+ int status;
+
+ status = SIpoll( si_ctx, 1 );
+ errors += fail_if_true( status != 0, "poll failed" );
+
+ return errors;
+}
+