Skip to content

modified existing extrema algo tests#6724

Closed
sleepingeight wants to merge 1 commit intoTheHPXProject:masterfrom
sleepingeight:extrema_algo_tests
Closed

modified existing extrema algo tests#6724
sleepingeight wants to merge 1 commit intoTheHPXProject:masterfrom
sleepingeight:extrema_algo_tests

Conversation

@sleepingeight
Copy link
Copy Markdown
Contributor

@sleepingeight sleepingeight commented Jun 22, 2025

Fixes #6627

Proposed Changes

  • Added a new test utility random_repeat to generate vectors having repeated values.
  • This utility is used to test the extrema algorithms, and I've verified that the existing implementations work properly.

Any background context you want to provide?

Used uniform_int_distribution to generate random numbers.
Tests for container_algorithms can also be modified, but the tests need to be modified to not use sentinel (as we have duplicate values in our vector). I can update the tests if usage of sentinel can be removed in these tests.

Checklist

Not all points below apply to all pull requests.

  • I have added a new feature and have added tests to go along with it.
  • I have fixed a bug and have added a regression test.
  • I have added a test using random numbers; I have made sure it uses a seed, and that random numbers generated are valid inputs for the tests.

Signed-off-by: Surya Teja <theallrounder.mst@gmail.com>
@StellarBot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@sleepingeight sleepingeight marked this pull request as ready for review June 22, 2025 12:44
@sleepingeight sleepingeight requested a review from hkaiser as a code owner June 22, 2025 12:44
@sleepingeight sleepingeight changed the title modified existing tests modified existing extrema algo tests Jun 22, 2025
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Jun 22, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for dcf267d1
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (dcf267d) Report Missing Report Missing Report Missing
Head commit (c88e3ec) 193847 165033 85.14%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#6724) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

Copy link
Copy Markdown
Contributor

@hkaiser hkaiser left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@hkaiser
Copy link
Copy Markdown
Contributor

hkaiser commented Jun 24, 2025

  • This utility is used to test the extrema algorithms, and I've verified that the existing implementations work properly.

I wouldn't like removing the tests realted to sentinels.

0lem1of1 added a commit to 0lem1of1/hpx that referenced this pull request Feb 2, 2026
…extrema algorithms

- Added random_repeat utility for duplicate testing
- Updated extrema algorithm tests to use random_repeat
- Fixed sentinel test failures by injecting unique values
- Supersedes TheHPXProject#6684 and TheHPXProject#6724

Signed-off-by: Dhyann Olemmyan <olemmyandhyan@gmail.com>
0lem1of1 added a commit to 0lem1of1/hpx that referenced this pull request Feb 2, 2026
…extrema algorithms

- Added random_repeat utility for duplicate testing
- Updated extrema algorithm tests to use random_repeat
- Fixed sentinel test failures by injecting unique values
- Supersedes TheHPXProject#6684 and TheHPXProject#6724

Signed-off-by: Dhyann Olemmyan <olemmyandhyan@gmail.com>
0lem1of1 added a commit to 0lem1of1/hpx that referenced this pull request Feb 2, 2026
…extrema algorithms

- Added random_repeat utility for duplicate testing
- Updated extrema algorithm tests to use random_repeat
- Fixed sentinel test failures by injecting unique values
- Supersedes TheHPXProject#6684 and TheHPXProject#6724

Signed-off-by: Dhyann Olemmyan <olemmyandhyan@gmail.com>
@sleepingeight
Copy link
Copy Markdown
Contributor Author

closing this since a PR solving this issue has already been merged.

@hkaiser hkaiser added this to the 2.0.0 milestone Feb 6, 2026
arpittkhandelwal pushed a commit to arpittkhandelwal/hpx that referenced this pull request Feb 8, 2026
…extrema algorithms

- Added random_repeat utility for duplicate testing
- Updated extrema algorithm tests to use random_repeat
- Fixed sentinel test failures by injecting unique values
- Supersedes TheHPXProject#6684 and TheHPXProject#6724

Signed-off-by: Dhyann Olemmyan <olemmyandhyan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extrema algorithms with repeated values

3 participants