-
Notifications
You must be signed in to change notification settings - Fork 17
π Added Unit Tests for GraphMatrix.hpp Functions #75
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
base: main
Are you sure you want to change the base?
Conversation
|
I appreciate you using the Google's testing framework, but Appledore has its own testing suite. Take a look at this PR. |
@SharonIV0x86 |
It looks like your code is still using GTest. Take a look at this short tutorial.
void test_totalDegree()
{
size_t observed_value = ggraph.totalDegree(v8);
if (observed_value == true_value_totalDegree_v8)
printColoredText("β test_totalDegree() PASSED!", ANSI_COLOR_GREEN);
else
printColoredText(std::format("β test_totalDegree() FAILED! \n\t Expected: {}, Got: {}", observed_value, true_value_totalDegree_v8), ANSI_COLOR_RED);
}
void test_getEdge()
{
int observed_edge = ggraph.getEdge(v1, v8);
int true_edge_value = 31;
if (observed_edge == true_edge_value)
printColoredText("β test_getEdge() PASSED!", ANSI_COLOR_GREEN);
else
printColoredText(std::format("β test_getEdge() FAILED! \n\t Expected: {}, Got: {}", true_edge_value, observed_edge), ANSI_COLOR_RED);
}
void init_tests()
{
//other functions.
test_getEdge(); //<- your new function to register here.
} I suggest you to write tests this way and remove the use of GTest. |
@tulu-g559 Status of your PR? |
@SharonIV0x86 |
No problem, you can work on new issues in future. ππΌ |
πΉ Summary
This PR adds unit tests for GraphMatrix.hpp in the test_suite/ folder, addressing the issue "Add Unit tests for GraphMatrix.hpp". The tests follow the structure defined in PR #59.
β Changes Made
Created GraphMatrixTest.cpp in test_suite/.
Added tests for the following functions:
Ensured consistency with the existing testing framework.
π Testing Done
Successfully compiled and executed tests using Google Test (gtest).
Verified expected outputs for all test cases.
π Issue Reference
Closes #64