Index: trunk/psLib/test/sys/tst_psLogMsg.c
===================================================================
--- trunk/psLib/test/sys/tst_psLogMsg.c	(revision 4951)
+++ trunk/psLib/test/sys/tst_psLogMsg.c	(revision 4979)
@@ -16,4 +16,5 @@
 static psS32 testLogMsg04();
 static psS32 testLogMsg05();
+static psS32 testLogMsg06();
 
 testDescription tests[] = {
@@ -35,4 +36,7 @@
                               {
                                   testLogMsg05, 5, "psLogSetDestination()", 0, false
+                              },
+                              {
+                                  testLogMsg06, 6, "psMessageDestination()", 0, false
                               },
                               {
@@ -236,2 +240,64 @@
     return 0;
 }
+
+psS32 testLogMsg06()
+{
+    psS32 i = 0;
+    //    FILE* file;
+    int fd;
+    //    char line[256];
+
+    printf("--------------- psMessageDestination(PS_LOG_NONE) ----------------\n");
+    psMessageDestination("none");
+    //    psLogSetDestination(0);
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+    printf("------------- psMessageDestination(PS_LOG_TO_STDERR) -------------\n");
+    psMessageDestination("dest:stderr");
+    //    psLogSetDestination(2);
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+    printf("------------- psMessageDestination(PS_LOG_TO_STDOUT) -------------\n");
+    psMessageDestination("dest:stdout");
+    //    psLogSetDestination(1);
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+    printf("--------------- psMessageDestination(""file:log2.txt"") ---------------\n");
+    fd = creat("log2.txt", 0666);
+    psMessageDestination("file:log2.txt");
+    //    psLogSetDestination(fd);
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+
+    psMessageDestination("none");
+    FILE *file;
+    char line[257];
+    //    psMessageDestination(-1);
+    //    psLogSetDestination(0);
+    printf("--------------------- The Contents of log2.txt -------------------\n");
+    file = fopen("log2.txt","r");
+    while ( fgets(line,256,file) != NULL ) {
+        printf("%s",line);
+    }
+    fclose(file);
+    close(fd);
+
+    int fd2 = creat("/eva/log2.txt", 0666);
+    printf("--------------- psMessageDestination(""file:/eva/log.txt"") ----------\n");
+    psMessageDestination("file:/eva/log2.txt");
+    //    psLogSetDestination(fd2);
+    for ( i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World! My level is %d\n", i);
+    }
+    close(fd2);
+
+    return 0;
+}
