Skip to content

Negative ranges #762#787

Merged
dmah42 merged 8 commits intogoogle:masterfrom
danielharvey458:negative_ranges_#762
Mar 26, 2019
Merged

Negative ranges #762#787
dmah42 merged 8 commits intogoogle:masterfrom
danielharvey458:negative_ranges_#762

Conversation

@danielharvey458
Copy link
Copy Markdown
Contributor

Add FIXME in multiple_ranges_test.cc 36c7640 -- this looks like a bug to me?

Improve handling of large bounds in AddRange 02a67f0 -- minor tweak to squeeze in an extra power of 'mult' in AddRanges

Enable negative values for Range argument 2ddf958 -- main proposed commit

Due to breaking the loop too early, AddRange
would miss a final multplier of 'mult' that
was within the numeric range of T.
Comment thread src/benchmark_register.h
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 24, 2019

Coverage Status

Coverage increased (+0.1%) to 89.597% when pulling 4a1a846 on danielharvey458:negative_ranges_#762 into fae8726 on google:master.

Comment thread src/benchmark_register.h
Comment thread test/benchmark_gtest.cc Outdated

namespace {

using namespace benchmark::internal;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

these tests should likely be in namespace benchmark::internal which you can add above.

namespace benchmark {
namespace internal {
namespace {

...

}  // namespace
}  // namespace internal
}  // namespace benchmark

Comment thread test/multiple_ranges_test.cc Outdated
// complete.
virtual ~MultipleRangesFixture() {
// FIXME Should the 'if' below be checking for equality
// of the values in the containers, rather than their size?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it should probably do both. The assert is no longer necessary as we're using for range loops (we used to loop using the index and it would crash) and instead we should be looping over both and comparing, then asserting/aborting with some sort of error.

Put unit tests in benchmark::internal namespace

Fix error reporting in multiple_ranges_test.cc
@dmah42 dmah42 merged commit e366656 into google:master Mar 26, 2019
@dmah42
Copy link
Copy Markdown
Member

dmah42 commented Mar 26, 2019

Thank you!

JBakamovic pushed a commit to JBakamovic/benchmark that referenced this pull request Sep 11, 2020
* Add FIXME in multiple_ranges_test.cc

* Improve handling of large bounds in AddRange.

Due to breaking the loop too early, AddRange
would miss a final multplier of 'mult' that
was within the numeric range of T.

* Enable negative values for Range argument

Fixes google#762.

* Try to fix build of benchmark_gtest

* Try some more to fix build

* Attempt to fix format macros

* Attempt to resolve format errors for mingw32

* Review feedback

Put unit tests in benchmark::internal namespace

Fix error reporting in multiple_ranges_test.cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants