pci: rework interrupt handling
[dpdk.git] / app / test / test_debug.c
index a10f6e8..b98239b 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  * 
- *   Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
  *   All rights reserved.
  * 
  *   Redistribution and use in source and binary forms, with or without 
@@ -113,11 +113,13 @@ test_exit_val(int exit_val)
        }
        wait(&status);
        printf("Child process status: %d\n", status);
+#ifndef RTE_EAL_ALWAYS_PANIC_ON_ERROR
        if(!WIFEXITED(status) || WEXITSTATUS(status) != (uint8_t)exit_val){
-               printf("Child process terminated with incorrect return code!\n");
+               printf("Child process terminated with incorrect status (expected = %d)!\n",
+                               exit_val);
                return -1;
        }
-
+#endif
        return 0;
 }
 
@@ -136,6 +138,26 @@ test_exit(void)
 
 #endif
 
+static void
+dummy_app_usage(const char *progname)
+{
+       RTE_SET_USED(progname);
+}
+
+static int
+test_usage(void)
+{
+       if (rte_set_application_usage_hook(dummy_app_usage) != NULL) {
+               printf("Non-NULL value returned for initial usage hook\n");
+               return -1;
+       }
+       if (rte_set_application_usage_hook(NULL) != dummy_app_usage) {
+               printf("Incorrect value returned for application usage hook\n");
+               return -1;
+       }
+       return 0;
+}
+
 int
 test_debug(void)
 {
@@ -145,5 +167,7 @@ test_debug(void)
                return -1;
        if (test_exit() < 0)
                return -1;
+       if (test_usage() < 0)
+               return -1;
        return 0;
 }