Skip to content

Conversation

@sleepingeight
Copy link

@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 <[email protected]>
@StellarBot
Copy link

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

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.03% 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (dcf267d) 194034 165080 85.08%
Head commit (c88e3ec) 193847 (-187) 164979 (-101) 85.11% (+0.03%)

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) 36 36 100.00%

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

Copy link
Member

@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
Member

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.

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