Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
3.3 KiB

  1. #ifndef __LOG_H__
  2. #define __LOG_H__
  3. #include "ntlog.h"
  4. /*****************************************************************************
  5. /* Macro definitions for logging test results
  6. /*****************************************************************************/
  7. #define LOG_ON() HIDTest_SetLogOnA(TRUE)
  8. #define LOG_OFF() HIDTest_SetLogOnA(FALSE)
  9. #define START_TEST(testname) HIDTest_LogStartTest(testname)
  10. #define START_TEST_ITERATION(iNum) HIDTest_LogStartTestIteration(iNum)
  11. #define START_VARIATION_ON_DEVICE_HANDLE(handle, legal) \
  12. HIDTest_LogStartVariationWithDeviceHandle((handle), \
  13. (legal), "")
  14. #define START_VARIATION_WITH_DEVICE_HANDLE(handle, legal, desc) \
  15. HIDTest_LogStartVariationWithDeviceHandle((handle), \
  16. (legal), (desc))
  17. #define START_VARIATION(variation) HIDTest_LogStartVariation(variation)
  18. #define LOG_VARIATION_RESULT(level, string) HIDTest_LogVariationResult(level, string)
  19. #define LOG_VARIATION_PASS() LOG_VARIATION_RESULT(TLS_PASS, "")
  20. #define LOG_VARIATION_FAIL() LOG_VARIATION_RESULT(TLS_SEV3, "")
  21. #define LOG_BUFFER_VALIDATION_FAIL() LOG_INTERMEDIATE_VARIATION_RESULT("Buffer validation failure");
  22. #define LOG_INVALID_RETURN_STATUS() LOG_INTERMEDIATE_VARIATION_RESULT("Invalid return status");
  23. #define LOG_INVALID_ERROR_CODE() LOG_INTERMEDIATE_VARIATION_RESULT("Invalid error code returned")
  24. #define LOG_INTERMEDIATE_VARIATION_RESULT(string) HIDTest_LogIntermediateVariationResult(string)
  25. #define LOG_TEST_ERROR(errmsg) HIDTest_LogTestError(errmsg)
  26. #define LOG_WARNING(warnmsg) HIDTest_LogTestWarning(warnmsg)
  27. #define END_VARIATION() HIDTest_LogEndVariation()
  28. #define END_TEST_ITERATION()
  29. #define END_TEST() HIDTest_LogEndTest()
  30. #define LOG_UNEXPECTED_STATUS_WARNING(funcname, status) \
  31. { \
  32. static CHAR wrnString[128]; \
  33. \
  34. wsprintf(wrnString, \
  35. "%s returned unexpected status: 0x%X", \
  36. funcname, \
  37. status \
  38. ); \
  39. \
  40. LOG_WARNING(wrnString); \
  41. }
  42. VOID
  43. HIDTest_LogStartTest(
  44. PCHAR TestName
  45. );
  46. VOID
  47. HIDTest_LogStartTestIteration(
  48. ULONG IterationNumber
  49. );
  50. VOID
  51. HIDTest_LogStartVariationWithDeviceHandle(
  52. HANDLE DeviceHandle,
  53. BOOL IsLegal,
  54. PCHAR Description
  55. );
  56. VOID
  57. HIDTest_LogStartVariation(
  58. PCHAR Variation
  59. );
  60. VOID
  61. HIDTest_LogVariationResult(
  62. INT Level,
  63. PCHAR VarString
  64. );
  65. VOID
  66. HIDTest_LogEndVariation(
  67. VOID
  68. );
  69. VOID
  70. HIDTest_LogEndTest(
  71. VOID
  72. );
  73. VOID
  74. HIDTest_LogIntermediateVariationResult(
  75. IN PCHAR VarResult
  76. );
  77. VOID
  78. HIDTest_LogTestWarning(
  79. IN PCHAR WarningMsg
  80. );
  81. VOID
  82. HIDTest_LogTestError(
  83. IN PCHAR ErrMsg
  84. );
  85. #endif