Skip to content

Commit

Permalink
Extended vector tests with random matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
mcopik committed Sep 5, 2017
1 parent 5994adc commit b920d64
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions tests/generator/random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ GENERATE_DIAGONAL_TEST(random_test, positive_medium, test_settings<>::medium_sq_
GENERATE_DIAGONAL_TEST(random_test, negative_small, test_settings<>::small_sq_sizes, generator::property::random(), generator::property::negative())
GENERATE_DIAGONAL_TEST(random_test, negative_medium, test_settings<>::medium_sq_sizes, generator::property::random(), generator::property::negative())

GENERATE_ROW_VECTOR_TEST(random_test, small, test_settings<>::row_vector_sizes, generator::property::random())
GENERATE_ROW_VECTOR_TEST(random_test, positive_small, test_settings<>::row_vector_sizes, generator::property::random(), generator::property::positive())
GENERATE_ROW_VECTOR_TEST(random_test, negative_small, test_settings<>::row_vector_sizes, generator::property::random(), generator::property::negative())

GENERATE_COL_VECTOR_TEST(random_test, small, test_settings<>::col_vector_sizes, generator::property::random())
GENERATE_COL_VECTOR_TEST(random_test, positive_small, test_settings<>::col_vector_sizes, generator::property::random(), generator::property::positive())
GENERATE_COL_VECTOR_TEST(random_test, negative_small, test_settings<>::col_vector_sizes, generator::property::random(), generator::property::negative())


int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
Expand Down
4 changes: 2 additions & 2 deletions tests/generator/test_utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ void verify_row_vec(MatType && mat, uint32_t, uint32_t cols, Properties &&... pr
typedef traits::matrix_traits< std::remove_reference_t<MatType> > traits_t;
typedef typename traits_t::value_t value_t;

EXPECT_EQ(traits_t::rows(mat), 1);
EXPECT_EQ(traits_t::rows(mat), 1u);
EXPECT_EQ(traits_t::columns(mat), cols);

for(uint32_t i = 0; i < cols; ++i) {
Expand All @@ -266,7 +266,7 @@ void verify_col_vec(MatType && mat, uint32_t rows, uint32_t, Properties &&... pr
typedef typename traits_t::value_t value_t;

EXPECT_EQ(traits_t::rows(mat), rows);
EXPECT_EQ(traits_t::columns(mat), 1);
EXPECT_EQ(traits_t::columns(mat), 1u);

for(uint32_t i = 0; i < rows; ++i) {
// the existence of traits method taking only one index verifies that MatType is indeed a vector
Expand Down

0 comments on commit b920d64

Please sign in to comment.