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.

42 lines
804 B

  1. #include "twlbssys.h"
  2. #include "diplist.h"
  3. BOOL test_diplist(void)
  4. {
  5. BOOL fRet;
  6. DIPLIST dl;
  7. int TestNo=0;
  8. DipListInitialize(&dl);
  9. DipListClear(&dl);
  10. DipListSetItem(&dl, 0, 1);
  11. TestNo=0;
  12. fRet = DipListCheckItem(&dl, 1);
  13. if (!fRet) goto end_fail; // Couldn't find item 1
  14. TestNo=1;
  15. fRet = DipListCheckItem(&dl, 2);
  16. if (fRet) goto end_fail; // we found item "2", but we shouldn't
  17. DipListSetItem(&dl, 0, 0);
  18. TestNo=2;
  19. fRet = DipListCheckItem(&dl, 1);
  20. if (fRet) goto end_fail; // we found item 1, but we shouldn't
  21. DipListDeinitialize(&dl);
  22. wprintf(L"test_diplist: SUCCEEDED!\n");
  23. return TRUE;
  24. end_fail:
  25. wprintf(L"DIPLIST Test#%lu failed!\n", TestNo);
  26. return FALSE;
  27. }