Skip to content
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

self test added for kruskals minimum spanning tree #2513

Closed
wants to merge 1 commit into from

Conversation

sOR-o
Copy link

@sOR-o sOR-o commented Jul 25, 2023

Description of Change

Added the self test cases for the greedy_algorithms/kruskals_minimum_spanning_tree.cpp issue #2509.

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Copy link
Member

@vil02 vil02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that the current implementation of the function greedy_algorithms::findMinimumEdge is not testable. What could be done to make it testable? What do you think about returning some array from it? At the moment this function displays some data - that makes it difficult to check if the result is correct.

Comment on lines +116 to +117
assert((greedy_algorithms::findMinimumEdge(MAX_WEIGHT, graph),
true)); // Test case 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me a while to find out what happens here.

INFINITY, INFINITY, INFINITY, 7, INFINITY, 0};

greedy_algorithms::findMinimumEdge(INFINITY, graph);
test();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
test();
test(); // run self-test implementations

@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2023

This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Author has not responded to the comments for over 2 weeks label Sep 3, 2023
@github-actions
Copy link
Contributor

Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@github-actions github-actions bot closed this Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Author has not responded to the comments for over 2 weeks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants