Updated test pass/fail print messages for test0

This commit is contained in:
Bahadir Balban
2009-05-28 13:23:44 +03:00
parent e61e9e9533
commit ab9e036cb7
11 changed files with 35 additions and 54 deletions

View File

@@ -33,7 +33,6 @@ void main(void)
wait_pager(0);
ipc_full_test();
printf("\n%s: Running POSIX API tests.\n", __TASKNAME__);
@@ -49,10 +48,11 @@ void main(void)
clonetest();
if (parent_of_all == getpid())
if (parent_of_all == getpid()) {
ipc_full_test();
ipc_extended_test();
else
exectest();
}
exectest();
while (1)
wait_pager(0);

View File

@@ -49,11 +49,11 @@ int clonetest(void)
/* TODO: Add wait() or something similar and check that global is 100 */
if (getpid() == parent_of_all)
printf("CLONE TEST -- PASSED --\n");
printf("CLONE TEST -- PASSED --\n");
return 0;
out_err:
printf("CLONE TEST -- FAILED --\n");
printf("CLONE TEST -- FAILED --\n");
return 0;
}

View File

@@ -203,11 +203,11 @@ int dirtest(void)
if (lsdir("/usr/./././bin//") < 0)
goto out_err;
printf("DIR TEST -- PASSED --\n");
printf("DIR TEST -- PASSED --\n");
return 0;
out_err:
printf("DIR TEST -- FAILED --\n");
printf("DIR TEST -- FAILED --\n");
return 0;
}

View File

@@ -54,7 +54,7 @@ int exectest(void)
execve(filename, argv, 0);
out_err:
printf("EXECVE TEST -- FAILED --\n");
printf("EXECVE TEST -- FAILED --\n");
return 0;
}

View File

@@ -62,11 +62,11 @@ int fileio(void)
}
if (getpid() == parent_of_all)
printf("FILE IO TEST -- PASSED --\n");
printf("FILE IO TEST -- PASSED --\n");
return 0;
out_err:
printf("FILE IO TEST -- FAILED --\n");
printf("FILE IO TEST -- FAILED --\n");
return 0;
}

View File

@@ -43,13 +43,13 @@ int forktest(void)
}
if (getpid() == parent_of_all)
printf("FORK TEST -- PASSED --\n");
printf("FORK TEST -- PASSED --\n");
return 0;
/* Any erroneous child or parent comes here */
out_err:
printf("FORK TEST -- FAILED --\n");
printf("FORK TEST -- FAILED --\n");
return 0;
}

View File

@@ -40,9 +40,9 @@ void ipc_full_test(void)
}
if (!ret)
printf("FULL IPC TEST: -- PASSED --\n");
printf("FULL IPC TEST: -- PASSED --\n");
else
printf("FULL IPC TEST: -- FAILED --\n");
printf("FULL IPC TEST: -- FAILED --\n");
}
/*
@@ -60,13 +60,13 @@ void ipc_extended_test(void)
/* Fork the current task */
if ((child = fork()) < 0) {
printf("%s: Fork failed with %d\n", __FUNCTION__, errno);
test_printf("%s: Fork failed with %d\n", __FUNCTION__, errno);
goto out_err;
}
if (child)
printf("%d: Created child with pid %d\n", getpid(), child);
test_printf("%d: Created child with pid %d\n", getpid(), child);
else
printf("Child %d running.\n", getpid());
test_printf("Child %d running.\n", getpid());
/* This test makes this assumption */
BUG_ON(L4_IPC_EXTENDED_MAX_SIZE > PAGE_SIZE);
@@ -81,7 +81,7 @@ void ipc_extended_test(void)
__FUNCTION__, (int)base);
goto out_err;
} else
printf("mmap: Anonymous private buffer at %p\n", base);
test_printf("mmap: Anonymous private buffer at %p\n", base);
/*
* Both tasks read/write both pages
@@ -100,7 +100,7 @@ void ipc_extended_test(void)
ipcbuf[L4_IPC_EXTENDED_MAX_SIZE - 1] = '\0';
/* Send message to parent */
printf("Child sending message: %s\n", ipcbuf);
test_printf("Child sending message: %s\n", ipcbuf);
if ((err = l4_send_extended(parent, L4_IPC_TAG_SYNC_EXTENDED,
L4_IPC_EXTENDED_MAX_SIZE,
ipcbuf)) < 0) {
@@ -116,7 +116,7 @@ void ipc_extended_test(void)
* This should prove that page faults are handled during
* the ipc.
*/
printf("Parent: extended receiving from child.\n");
test_printf("Parent: extended receiving from child.\n");
if ((err = l4_receive_extended(child, L4_IPC_EXTENDED_MAX_SIZE,
ipcbuf)) < 0) {
printf("Extended ipc error: %d\n", err);
@@ -124,7 +124,7 @@ void ipc_extended_test(void)
}
/* We now print the message created by child. */
printf("(%d): Message received from child: %s\n",
test_printf("(%d): Message received from child: %s\n",
getpid(), ipcbuf);
/* Check that string received from child is an exact match */
@@ -137,12 +137,12 @@ void ipc_extended_test(void)
if (ipcbuf[L4_IPC_EXTENDED_MAX_SIZE - 1] != '\0')
goto out_err;
printf("EXTENDED IPC TEST: -- PASSED --\n");
printf("EXTENDED IPC TEST: -- PASSED --\n");
}
return;
out_err:
printf("EXTENDED IPC TEST: -- FAILED --\n");
printf("EXTENDED IPC TEST: -- FAILED --\n");
}

View File

@@ -46,11 +46,11 @@ int mmaptest(void)
*(unsigned int *)(base + PAGE_SIZE*3) = 0x1000;
*(unsigned int *)(base + PAGE_SIZE*1) = 0x1000;
printf("MMAP TEST -- PASSED --\n");
printf("MMAP TEST -- PASSED --\n");
return 0;
out_err:
printf("MMAP TEST -- FAILED --\n");
printf("MMAP TEST -- FAILED --\n");
return 0;
}

View File

@@ -60,12 +60,12 @@ int shmtest(void)
}
if (getpid() == parent_of_all)
printf("SHM TEST -- PASSED --\n");
printf("SHM TEST -- PASSED --\n");
return 0;
out_err:
printf("SHM TEST -- FAILED --\n");
printf("SHM TEST -- FAILED --\n");
return 0;
}

View File

@@ -26,8 +26,8 @@ void main(void)
{
wait_pager(0);
if (getpid() == 2) {
printf("EXECVE TEST -- PASSED --\n", getpid());
printf("\n(Thread %d): Continues to sync with the pager...\n", getpid());
printf("EXECVE TEST -- PASSED --\n", getpid());
printf("\nThread (%d): Continues to sync with the pager...\n\n", getpid());
while (1)
wait_pager(0);
}