Skip to content

Create gol_tests.cpp #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

xWuWux
Copy link

@xWuWux xWuWux commented Oct 14, 2023

Include the necessary headers, such as gtest/gtest.h and your source file, gol.c.

Create a test case using TEST, which is part of the Google Test framework.

In the MoveNextStepTest test case, one should set up your board with specific values as needed. Then, one can call the move_next_step function, which you want to test.

After calling the function, it's nessecary to use ASSERT macros to make assertions about the expected results. For example, it's possible to use ASSERT_EQ to compare specific board elements with expected values.

In the main function, next step is to initialize the Google Test framework and run all the tests.

Include the necessary headers, such as gtest/gtest.h and your source file, gol.c.

Create a test case using TEST, which is part of the Google Test framework.

In the MoveNextStepTest test case, one should set up your board with specific values as needed. Then, one can call the move_next_step function, which you want to test.

After calling the function, it's nessecary to use ASSERT macros to make assertions about the expected results. For example, it's possible to use ASSERT_EQ to compare specific board elements with expected values.

In the main function, next step is to initialize the Google Test framework and run all the tests.
@xWuWux
Copy link
Author

xWuWux commented Oct 14, 2023

To compile and run the tests, you need to link against the Google Test library and your source file. You can use a command like:

g++ -o gol_tests gol_tests.cpp -lgtest -lgtest_main -pthread

ensure that you have the Google Test library installed and available for linking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant