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.

87 lines
1.6 KiB

  1. #include <nt.h> // TIME definition
  2. #include <ntrtl.h> // TIME definition
  3. #include <nturtl.h> // TIME definition
  4. #define NOMINMAX // Avoid redefinition of min and max in stdlib.h
  5. #include <windef.h>
  6. #include <winbase.h>
  7. #include <stdio.h>
  8. #include <lmcons.h>
  9. #include <netlib.h>
  10. #include <netdebug.h>
  11. #define UASTEST_ALLOCATE
  12. #include "uastest.h"
  13. void PrintUnicode(
  14. LPWSTR string
  15. )
  16. {
  17. if ( string != NULL ) {
  18. printf( "%ws", string );
  19. } else {
  20. printf( "<null>" );
  21. }
  22. }
  23. //
  24. // Print error when two dwords are different
  25. //
  26. void TestDiffDword(
  27. char *msgp,
  28. LPWSTR namep,
  29. DWORD Actual,
  30. DWORD Good
  31. )
  32. {
  33. if ( Actual != Good ) {
  34. error_exit( FAIL, msgp, namep );
  35. printf( " %ld should be %ld\n", Actual, Good );
  36. }
  37. }
  38. //
  39. // error_exit print the error message and exit if EXIT_FLAG set
  40. //
  41. void
  42. error_exit(
  43. int type,
  44. char *msgp,
  45. LPWSTR namep
  46. )
  47. {
  48. printf("%s: ", testname );
  49. if ( type == ACTION ) {
  50. printf( "ACTION - " );
  51. } else if ( type == FAIL ) {
  52. printf( "FAIL - " );
  53. } else if ( type == PASS ) {
  54. printf( "PASS - " );
  55. }
  56. if ( namep != NULL ) {
  57. PrintUnicode( namep );
  58. printf( ": ");
  59. }
  60. printf("%s", msgp);
  61. if ( type != ACTION && err != 0) {
  62. printf(" Error = %d", err);
  63. if ( err == ERROR_INVALID_PARAMETER ) {
  64. printf(" ParmError = %d", ParmError );
  65. }
  66. }
  67. printf("\n");
  68. if ( type == FAIL ) {
  69. // NetpAssert(FALSE);
  70. TEXIT;
  71. }
  72. }