Conversation
| * For more details, see http://www.mrtrix.org/. | ||
| */ | ||
|
|
||
| #include "gtest/gtest.h" |
There was a problem hiding this comment.
warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]
#include "gtest/gtest.h"
^| bool initial_fill_value; | ||
| }; | ||
|
|
||
| TEST_P(BitSetParamTest, ConstructorAndInitialState) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_P(BitSetParamTest, ConstructorAndInitialState) { | |
| TEST_P(BitSetParamTest /*unused*/, ConstructorAndInitialState /*unused*/) { |
| } | ||
| } | ||
|
|
||
| TEST_P(BitSetParamTest, CopyConstructorAndEquality) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_P(BitSetParamTest, CopyConstructorAndEquality) { | |
| TEST_P(BitSetParamTest /*unused*/, CopyConstructorAndEquality /*unused*/) { |
| } | ||
| } | ||
|
|
||
| TEST_P(BitSetParamTest, AssignmentOperator) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_P(BitSetParamTest, AssignmentOperator) { | |
| TEST_P(BitSetParamTest /*unused*/, AssignmentOperator /*unused*/) { |
| TEST_P(BitSetParamTest, AssignmentOperator) { | ||
| for (size_t num_bits = 0; num_bits < 16; ++num_bits) { | ||
| const MR::BitSet source(num_bits, initial_fill_value); | ||
| const bool other_fill_value = !initial_fill_value; |
There was a problem hiding this comment.
warning: variable 'other_fill_value' is not initialized [cppcoreguidelines-init-variables]
| const bool other_fill_value = !initial_fill_value; | |
| const bool other_fill_value = false = !initial_fill_value; |
| TEST_F(OrderedQueueTest, Regular2Stage) { | ||
| const MR::Timer timer; | ||
|
|
||
| SourceFunctor source; |
There was a problem hiding this comment.
warning: variable 'source' of type 'SourceFunctor' can be declared 'const' [misc-const-correctness]
| SourceFunctor source; | |
| SourceFunctor const source; |
| const MR::Timer timer; | ||
|
|
||
| SourceFunctor source; | ||
| SinkFunctor sink; |
There was a problem hiding this comment.
warning: variable 'sink' of type 'SinkFunctor' can be declared 'const' [misc-const-correctness]
| SinkFunctor sink; | |
| SinkFunctor const sink; |
| PerformChecksAndLog(timer, sink, OrderEnforcement::Enforce); | ||
| } | ||
|
|
||
| TEST_F(OrderedQueueTest, Batched2Stage) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(OrderedQueueTest, Batched2Stage) { | |
| TEST_F(OrderedQueueTest /*unused*/, Batched2Stage /*unused*/) { |
| PerformChecksAndLog(timer, sink, OrderEnforcement::Enforce); | ||
| } | ||
|
|
||
| TEST_F(OrderedQueueTest, Regular3Stage) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(OrderedQueueTest, Regular3Stage) { | |
| TEST_F(OrderedQueueTest /*unused*/, Regular3Stage /*unused*/) { |
| PerformChecksAndLog(timer, sink, OrderEnforcement::DoNotEnforce); | ||
| } | ||
|
|
||
| TEST_F(OrderedQueueTest, BatchedUnbatched3Stage) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(OrderedQueueTest, BatchedUnbatched3Stage) { | |
| TEST_F(OrderedQueueTest /*unused*/, BatchedUnbatched3Stage /*unused*/) { |
- Runs every combination of bit-set size in [0-15] and initial fill value. - New scenarios: - assignment-operator equivalence - resize-shrink paths and round-trip through size 0 - explicit mixed-state sanity checks
| PerformChecksAndLog(timer, sink, OrderEnforcement::DoNotEnforce); | ||
| } | ||
|
|
||
| TEST_F(OrderedQueueTest, UnbatchedBatched3Stage) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(OrderedQueueTest, UnbatchedBatched3Stage) { | |
| TEST_F(OrderedQueueTest /*unused*/, UnbatchedBatched3Stage /*unused*/) { |
| PerformChecksAndLog(timer, sink, OrderEnforcement::DoNotEnforce); | ||
| } | ||
|
|
||
| TEST_F(OrderedQueueTest, BatchedBatchedRegular3Stage) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(OrderedQueueTest, BatchedBatchedRegular3Stage) { | |
| TEST_F(OrderedQueueTest /*unused*/, BatchedBatchedRegular3Stage /*unused*/) { |
| PerformChecksAndLog(timer, sink, OrderEnforcement::DoNotEnforce); | ||
| } | ||
|
|
||
| TEST_F(OrderedQueueTest, Regular4Stage) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(OrderedQueueTest, Regular4Stage) { | |
| TEST_F(OrderedQueueTest /*unused*/, Regular4Stage /*unused*/) { |
| PerformChecksAndLog(timer, sink, OrderEnforcement::DoNotEnforce); | ||
| } | ||
|
|
||
| TEST_F(OrderedQueueTest, BatchedUnbatchedUnbatched4Stage) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(OrderedQueueTest, BatchedUnbatchedUnbatched4Stage) { | |
| TEST_F(OrderedQueueTest /*unused*/, BatchedUnbatchedUnbatched4Stage /*unused*/) { |
| PerformChecksAndLog(timer, sink, OrderEnforcement::DoNotEnforce); | ||
| } | ||
|
|
||
| TEST_F(OrderedQueueTest, UnbatchedBatchedUnbatched4Stage) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(OrderedQueueTest, UnbatchedBatchedUnbatched4Stage) { | |
| TEST_F(OrderedQueueTest /*unused*/, UnbatchedBatchedUnbatched4Stage /*unused*/) { |
| } | ||
| } | ||
|
|
||
| TEST_F(ROITests, ThreeOrderedROIsCorrectOrder) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(ROITests, ThreeOrderedROIsCorrectOrder) { | |
| TEST_F(ROITests /*unused*/, ThreeOrderedROIsCorrectOrder /*unused*/) { |
| } | ||
| } | ||
|
|
||
| TEST_F(ROITests, ThreeOrderedROIsIllegalABA) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(ROITests, ThreeOrderedROIsIllegalABA) { | |
| TEST_F(ROITests /*unused*/, ThreeOrderedROIsIllegalABA /*unused*/) { |
| } | ||
| } | ||
|
|
||
| TEST_F(ROITests, FourOrderedROIsIllegalABCAD) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(ROITests, FourOrderedROIsIllegalABCAD) { | |
| TEST_F(ROITests /*unused*/, FourOrderedROIsIllegalABCAD /*unused*/) { |
| } | ||
| } | ||
|
|
||
| TEST_F(ROITests, CombinationOrderedAndUnorderedROIs) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(ROITests, CombinationOrderedAndUnorderedROIs) { | |
| TEST_F(ROITests /*unused*/, CombinationOrderedAndUnorderedROIs /*unused*/) { |
|
|
||
| #include <Eigen/Core> | ||
| #include <algorithm> | ||
| #include <gtest/gtest.h> |
There was a problem hiding this comment.
warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]
#include <gtest/gtest.h>
^Using CTAD runs into deep fold expressions and exceed's template nesting limits on both Clang and GCC.
| void PrintTo(const ShufflerParams ¶ms, ::std::ostream *os) { *os << "{" << params.name << "}"; } | ||
|
|
||
| std::vector<ShufflerParams> GetShufflerTestParams() { | ||
| std::vector<ShufflerParams> all_params; |
There was a problem hiding this comment.
warning: variable 'all_params' is not initialized [cppcoreguidelines-init-variables]
| std::vector<ShufflerParams> all_params; | |
| std::vector<ShufflerParams> all_params = 0; |
| } | ||
| } // namespace | ||
|
|
||
| class ShufflerTest : public ::testing::Test { |
There was a problem hiding this comment.
warning: constructor does not initialize these fields: blocks [cppcoreguidelines-pro-type-member-init]
testing/unit_tests/shuffle_tests.cpp:208:
- std::vector<std::set<size_t>> blocks;
+ std::vector<std::set<size_t>> blocks{};| blocks[block_indices[i]].insert(i); | ||
| } | ||
|
|
||
| void TestPermutationWithin(Shuffler &in, const std::string &fail_msg) { |
There was a problem hiding this comment.
warning: method 'TestPermutationWithin' can be made static [readability-convert-member-functions-to-static]
| void TestPermutationWithin(Shuffler &in, const std::string &fail_msg) { | |
| static void TestPermutationWithin(Shuffler &in, const std::string &fail_msg) { |
| void TestPermutationWithin(Shuffler &in, const std::string &fail_msg) { | ||
| in.reset(); | ||
| Shuffle shuffle; | ||
| Eigen::Array<int, Eigen::Dynamic, 1> shuffled_data; |
There was a problem hiding this comment.
warning: variable 'shuffled_data' is not initialized [cppcoreguidelines-init-variables]
| Eigen::Array<int, Eigen::Dynamic, 1> shuffled_data; | |
| Eigen::Array<int, Eigen::Dynamic, 1> shuffled_data = 0; |
| } | ||
| } | ||
|
|
||
| void TestSignflipWhole(Shuffler &in, const std::string &fail_msg) { |
There was a problem hiding this comment.
warning: method 'TestSignflipWhole' can be made static [readability-convert-member-functions-to-static]
| void TestSignflipWhole(Shuffler &in, const std::string &fail_msg) { | |
| static void TestSignflipWhole(Shuffler &in, const std::string &fail_msg) { |
| * For more details, see http://www.mrtrix.org/. | ||
| */ | ||
|
|
||
| #include "gtest/gtest.h" |
There was a problem hiding this comment.
warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]
#include "gtest/gtest.h"
^|
|
||
| class ToBoolTest : public ::testing::Test {}; | ||
|
|
||
| TEST_F(ToBoolTest, StringToBoolConversion) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(ToBoolTest, StringToBoolConversion) { | |
| TEST_F(ToBoolTest /*unused*/, StringToBoolConversion /*unused*/) { |
|
|
||
| class ToIntTest : public ::testing::Test {}; | ||
|
|
||
| TEST_F(ToIntTest, StringToIntConversion) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(ToIntTest, StringToIntConversion) { | |
| TEST_F(ToIntTest /*unused*/, StringToIntConversion /*unused*/) { |
|
|
||
| class ToFloatTest : public ::testing::Test {}; | ||
|
|
||
| TEST_F(ToFloatTest, StringToFloatConversion) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(ToFloatTest, StringToFloatConversion) { | |
| TEST_F(ToFloatTest /*unused*/, StringToFloatConversion /*unused*/) { |
|
|
||
| class ToComplexFloatTest : public ::testing::Test {}; | ||
|
|
||
| TEST_F(ToComplexFloatTest, StringToComplexFloatConversion) { |
There was a problem hiding this comment.
warning: all parameters should be named in a function [readability-named-parameter]
| TEST_F(ToComplexFloatTest, StringToComplexFloatConversion) { | |
| TEST_F(ToComplexFloatTest /*unused*/, StringToComplexFloatConversion /*unused*/) { |
70031c3 to
6bf4cec
Compare
This PR ports all of our existing tests in
testing/unit_teststo use the Google Test, a widely adopted unit testing framework in the C++ world. All tests have been rewritten to leverage the Google Test API, replacing our previous in-house solution. All tests should provide the same coverage as before. The exception is the tests for our dynamicMR::BitSetclass, where the new set of tests should be slightly more comprehensive than the previous ones.On the CMake side, the only needed change is the addition of Google Test in
cmake/Dependencies.cmakeand very minimal changes to the CMake logic inunit_tests/CMakeLists.txt.