Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void test_check_valid_input() {
- int test_row = 0;
- int test_col = 0;
- cout << "Testing check_valid_input" << endl;
- // row_input Checks
- cout << "1.1) Expected: Invalid Received:" << endl;
- check_valid_input(MAX_SIZE, 0, 'A', 'X', test_row, test_col);
- cout << "1.2) Expected: Invalid Received:" << endl;
- check_valid_input(MAX_SIZE, 9, 'A', 'X', test_row, test_col);
- cout << "1.3) Expected: Invalid Received:" << endl;
- check_valid_input(MAX_SIZE, 'A', 'A', 'X', test_row, test_col);
- cout << endl;
- // col_input Checks
- cout << "2.1) Expected: Invalid Recieved:" << endl;
- check_valid_input(MAX_SIZE, 1, 'J', 'X', test_row, test_col);
- cout << "2.2) Expected: Invalid Recieved:" << endl;
- check_valid_input(MAX_SIZE, 1, 5, 'X', test_row, test_col);
- cout << "2.3) Expected: Invalid Recieved:" << endl;
- check_valid_input(MAX_SIZE, 1, '{', 'X', test_row, test_col);
- cout << endl;
- // color_char Checks
- cout << "3.1) Expected: Invalid Recieved:" << endl;
- check_valid_input(MAX_SIZE, 1, 'A', '0', test_row, test_col);
- cout << "3.2) Expected: Invalid Recieved:" << endl;
- check_valid_input(MAX_SIZE, 1, 'A', 1, test_row, test_col);
- cout << "3.3) Expected: Invalid Recieved:" << endl;
- check_valid_input(MAX_SIZE, 1, 'A', 'k', test_row, test_col);
- cout << "3.4) Expected: Invalid Recieved:" << endl;
- check_valid_input(MAX_SIZE, 1, 'A', 'N', test_row, test_col);
- cout << "3.5) Expected: Invalid Recieved:" << endl;
- check_valid_input(MAX_SIZE, 1, 'A', 'r', test_row, test_col);
- cout << endl;
- // Valid Inputs
- cout << "4.1) Expected: No print. Received:" << endl;
- check_valid_input(MAX_SIZE, 1, 'A', 'X', test_row, test_col);
- cout << "4.2) Expected: No print. Received:" << endl;
- check_valid_input(MAX_SIZE, 8, 'A', 'X', test_row, test_col);
- cout << "4.3) Expected: No print. Received:" << endl;
- check_valid_input(MAX_SIZE, 1, 'a', 'X', test_row, test_col);
- cout << "4.4) Expected: No print. Received:" << endl;
- check_valid_input(MAX_SIZE, 1, 'B', 'X', test_row, test_col);
- cout << "4.5) Expected: No print. Received:" << endl;
- check_valid_input(MAX_SIZE, 1, 'b', 'X', test_row, test_col);
- cout << "4.6) Expected: No print. Received:" << endl;
- check_valid_input(MAX_SIZE, 1, 'A', 'O', test_row, test_col);
- cout << "4.7) Expected: No print. Received:" << endl;
- check_valid_input(MAX_SIZE, 1, 'A', 'o', test_row, test_col);
- cout << "4.8) Expected: No print. Received:" << endl;
- check_valid_input(MAX_SIZE, 1, 'A', 'x', test_row, test_col);
- cout << endl;
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement