Skip to content

Add unit tests for utility functions#184

Merged
macite merged 2 commits intosplashkit:developfrom
matt439:add-utility-unit-tests
Oct 18, 2024
Merged

Add unit tests for utility functions#184
macite merged 2 commits intosplashkit:developfrom
matt439:add-utility-unit-tests

Conversation

@matt439
Copy link
Contributor

@matt439 matt439 commented Oct 3, 2024

ThothTech fork pull request: thoth-tech#68

Description

There are currently no unit tests for the functions listed under 'Utilities' in the SplashKit documentation. I have created exhaustive tests for each of these functions apart from display_dialog as it is generates purely graphical content and would be better suited for sktests.

In the process of creating the tests, I have identified issues with replace_all, rnd and rnd(min, max). I can consistently cause an infinite loop in replace_all, and an unhanded exception in the two overloads of rnd. Keeping those tests in skunit_tests will cause it to fail. As a compromise, I have left the tests in place and commented them. My intention is to create separate pull requests to rectify the faulty functions. Once they are fixed, the tests can be uncommented.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Adding the new tests was achieved by running cmake -G "Unix Makefiles" . followed by make when in the /splashkit-core/projects/cmake directory.

Testing Checklist

  • Tested with skunit_tests

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • My changes generate no new warnings
  • I have requested a review from ... on the Pull Request

@macite macite merged commit 38310fe into splashkit:develop Oct 18, 2024
@matt439 matt439 deleted the add-utility-unit-tests branch November 1, 2024 01:35
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.

2 participants