Advertisement
Guest User

STEHPEN

a guest
Oct 25th, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. void test_check_valid_input() {
  2. int test_row = 0;
  3. int test_col = 0;
  4.  
  5. cout << "Testing check_valid_input" << endl;
  6.  
  7. // row_input Checks
  8. cout << "1.1) Expected: Invalid Received:" << endl;
  9. check_valid_input(MAX_SIZE, 0, 'A', 'X', test_row, test_col);
  10. cout << "1.2) Expected: Invalid Received:" << endl;
  11. check_valid_input(MAX_SIZE, 9, 'A', 'X', test_row, test_col);
  12. cout << "1.3) Expected: Invalid Received:" << endl;
  13. check_valid_input(MAX_SIZE, 'A', 'A', 'X', test_row, test_col);
  14. cout << endl;
  15.  
  16. // col_input Checks
  17. cout << "2.1) Expected: Invalid Recieved:" << endl;
  18. check_valid_input(MAX_SIZE, 1, 'J', 'X', test_row, test_col);
  19. cout << "2.2) Expected: Invalid Recieved:" << endl;
  20. check_valid_input(MAX_SIZE, 1, 5, 'X', test_row, test_col);
  21. cout << "2.3) Expected: Invalid Recieved:" << endl;
  22. check_valid_input(MAX_SIZE, 1, '{', 'X', test_row, test_col);
  23. cout << endl;
  24.  
  25. // color_char Checks
  26. cout << "3.1) Expected: Invalid Recieved:" << endl;
  27. check_valid_input(MAX_SIZE, 1, 'A', '0', test_row, test_col);
  28. cout << "3.2) Expected: Invalid Recieved:" << endl;
  29. check_valid_input(MAX_SIZE, 1, 'A', 1, test_row, test_col);
  30. cout << "3.3) Expected: Invalid Recieved:" << endl;
  31. check_valid_input(MAX_SIZE, 1, 'A', 'k', test_row, test_col);
  32. cout << "3.4) Expected: Invalid Recieved:" << endl;
  33. check_valid_input(MAX_SIZE, 1, 'A', 'N', test_row, test_col);
  34. cout << "3.5) Expected: Invalid Recieved:" << endl;
  35. check_valid_input(MAX_SIZE, 1, 'A', 'r', test_row, test_col);
  36. cout << endl;
  37.  
  38.  
  39. // Valid Inputs
  40. cout << "4.1) Expected: No print. Received:" << endl;
  41. check_valid_input(MAX_SIZE, 1, 'A', 'X', test_row, test_col);
  42. cout << "4.2) Expected: No print. Received:" << endl;
  43. check_valid_input(MAX_SIZE, 8, 'A', 'X', test_row, test_col);
  44. cout << "4.3) Expected: No print. Received:" << endl;
  45. check_valid_input(MAX_SIZE, 1, 'a', 'X', test_row, test_col);
  46. cout << "4.4) Expected: No print. Received:" << endl;
  47. check_valid_input(MAX_SIZE, 1, 'B', 'X', test_row, test_col);
  48. cout << "4.5) Expected: No print. Received:" << endl;
  49. check_valid_input(MAX_SIZE, 1, 'b', 'X', test_row, test_col);
  50. cout << "4.6) Expected: No print. Received:" << endl;
  51. check_valid_input(MAX_SIZE, 1, 'A', 'O', test_row, test_col);
  52. cout << "4.7) Expected: No print. Received:" << endl;
  53. check_valid_input(MAX_SIZE, 1, 'A', 'o', test_row, test_col);
  54. cout << "4.8) Expected: No print. Received:" << endl;
  55. check_valid_input(MAX_SIZE, 1, 'A', 'x', test_row, test_col);
  56. cout << endl;
  57.  
  58.  
  59. return;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement