/* SILC Net API tests */
-#include "silc.h"
+#include "silcruntime.h"
SilcSchedule schedule;
SilcFSMThreadStruct thread;
SilcNetListener server;
SilcStream client_stream;
- SilcNetStatus client_status;
+ SilcResult client_status;
SilcStream server_stream;
- SilcNetStatus server_status;
+ SilcResult server_status;
SilcBool success;
} *Foo;
SILC_FSM_STATE(test_st_connect);
SILC_FSM_STATE(test_st_connected);
-static void test_accept_connection(SilcNetStatus status, SilcStream stream,
+static void test_accept_connection(SilcResult status, SilcStream stream,
void *context)
{
Foo f = context;
SILC_FSM_EVENT_SIGNAL(&f->sema);
}
-static void test_connected(SilcNetStatus status, SilcStream stream,
+static void test_connected(SilcResult status, SilcStream stream,
void *context)
{
Foo f = context;
SILC_LOG_DEBUG(("test_st_connected"));
- if (f->server_status != SILC_NET_OK) {
+ if (f->server_status != SILC_OK) {
SILC_LOG_DEBUG(("Creating connection failed"));
return SILC_FSM_FINISH;
}
SILC_FSM_EVENT_WAIT(&f->sema);
- if (f->client_status != SILC_NET_OK) {
+ if (f->client_status != SILC_OK) {
/** Accepting new connection failed */
SILC_LOG_DEBUG(("Accepting failed %d", f->client_status));
silc_fsm_next(fsm, test_st_finish);
if (argc > 1 && !strcmp(argv[1], "-d")) {
silc_log_debug(TRUE);
silc_log_debug_hexdump(TRUE);
- silc_log_set_debug_string("*net*,*stream*");
+ silc_log_set_debug_string("*net*,*stream*,*errno*");
}
SILC_LOG_DEBUG(("Allocating scheduler"));
- schedule = silc_schedule_init(0, NULL, NULL);
+ schedule = silc_schedule_init(0, NULL, NULL, NULL);
f = silc_calloc(1, sizeof(*f));
if (!f)
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}