-#ifdef TEST
-
-static struct main_process mp;
-static struct main_file fin, fout;
-static struct main_hook hook;
-static struct main_timer tm;
-
-static byte rb[16];
-
-static void dread(struct main_file *fi)
-{
- if (fi->rpos < fi->rlen)
- {
- msg(L_INFO, "Read EOF");
- file_del(fi);
- }
- else
- {
- msg(L_INFO, "Read done");
- file_read(fi, rb, sizeof(rb));
- }
-}
-
-static void derror(struct main_file *fi, int cause)
-{
- msg(L_INFO, "Error: %m !!! (cause %d)", cause);
- file_del(fi);
-}
-
-static void dwrite(struct main_file *fi UNUSED)
-{
- msg(L_INFO, "Write done");
-}
-
-static int dhook(struct main_hook *ho UNUSED)
-{
- msg(L_INFO, "Hook called");
- return 0;
-}
-
-static void dtimer(struct main_timer *tm)
-{
- msg(L_INFO, "Timer tick");
- timer_add(tm, main_get_now() + 10000);
-}
-
-static void dentry(void)
-{
- msg(L_INFO, "*** SUBPROCESS START ***");
- sleep(2);
- msg(L_INFO, "*** SUBPROCESS FINISH ***");
- exit(0);
-}
-
-static void dexit(struct main_process *pr)
-{
- msg(L_INFO, "Subprocess %d exited with status %x", pr->pid, pr->status);
-}
-
-int
-main(void)