Notes
This function is in beta test. Please help improve it in the issues
here.
Hints
Your answer may be identical to the JOJ answer in the first several lines.
However, the main problem you meet now is Runtime Error. And the exit code of your program is 1, which should be 0.
Please double check your code to solve this problem and try again.
Your Answer
Running main() from gtest_main.cc Note: Google Test filter = Board.GetEmptySquareStr [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from Board [ RUN ] Board.GetEmptySquareStr /out/build/compile/gtest/test_board.cpp:53: Failure Expected: &square Which is: 0x7ffdc9987bb0 To be equal to: &board.grid[i][j] Which is: 0x7ffdc9987be0 /out/build/compile/gtest/test_board.cpp:53: Failure Expected: &square Which is: 0x7ffdc9987bc0 To be equal to: &board.grid[i][j] Which is: 0x7ffdc9987c20 /out/build/compile/gtest/test_board.cpp:53: Failure Expected: &square Which is: 0x7ffdc9987bd0 To be equal to: &board.grid[i][j] Which is: 0x7ffdc9987c60 [ FAILED ] Board.GetEmptySquareStr [----------] Global test environment tear-down [==========] 1 test from 1 test case ran. [ PASSED ] 0 tests. [ FAILED ] 1 test, listed below: [ FAILED ] Board.GetEmptySquareStr 1 FAILED TEST
JOJ Answer
Running main() from gtest_main.cc Note: Google Test filter = Board.GetEmptySquareStr [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from Board [ RUN ] Board.GetEmptySquareStr [ OK ] Board.GetEmptySquareStr [----------] Global test environment tear-down [==========] 1 test from 1 test case ran. [ PASSED ] 1 test.