Leaked source code of windows server 2003
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.

71 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1998-2001 Microsoft Corporation
  3. Module Name :
  4. HashTest.cpp
  5. Abstract:
  6. Test harness for LKRhash
  7. Author:
  8. George V. Reilly (GeorgeRe) 06-Jan-1998
  9. Environment:
  10. Win32 - User Mode
  11. Project:
  12. LKRhash
  13. Revision History:
  14. --*/
  15. #include "precomp.hxx"
  16. #include "WordHash.h"
  17. #include "IniFile.h"
  18. int __cdecl
  19. _tmain(
  20. int argc,
  21. TCHAR **argv)
  22. {
  23. TCHAR tszIniFile[MAX_PATH];
  24. CIniFileSettings ifs;
  25. if (argc == 2)
  26. {
  27. GetFullPathName(argv[1], MAX_PATH, tszIniFile, NULL);
  28. ifs.ReadIniFile(tszIniFile);
  29. FILE* fp = _tfopen(ifs.m_tszDataFile, _TEXT("r"));
  30. if (fp == NULL)
  31. {
  32. TCHAR tszDrive[_MAX_DRIVE], tszDir[_MAX_DIR];
  33. _tsplitpath(tszIniFile, tszDrive, tszDir, NULL, NULL);
  34. _stprintf(tszIniFile, "%s%s%s", tszDrive, tszDir,
  35. ifs.m_tszDataFile);
  36. _tcscpy(ifs.m_tszDataFile, tszIniFile);
  37. fp = _tfopen(ifs.m_tszDataFile, _TEXT("r"));
  38. }
  39. if (fp != NULL)
  40. fclose(fp);
  41. else
  42. _ftprintf(stderr, _TEXT("%s: Can't open datafile `%s'.\n"),
  43. argv[0], ifs.m_tszDataFile) ;
  44. }
  45. else
  46. {
  47. _ftprintf(stderr, _TEXT("Usage: %s ini-file\n"), argv[0]);
  48. exit(1);
  49. }
  50. LKR_TestHashTable(ifs);
  51. return(0) ;
  52. }