From b920d642de34a0dfbdf443fe0ad44db02b74be95 Mon Sep 17 00:00:00 2001 From: mcopik Date: Wed, 6 Sep 2017 01:33:54 +0200 Subject: [PATCH] Extended vector tests with random matrices --- tests/generator/random.cpp | 8 ++++++++ tests/generator/test_utilities.hpp | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/generator/random.cpp b/tests/generator/random.cpp index 06c61a8..3b9ce47 100644 --- a/tests/generator/random.cpp +++ b/tests/generator/random.cpp @@ -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); diff --git a/tests/generator/test_utilities.hpp b/tests/generator/test_utilities.hpp index 63af108..6ee030e 100644 --- a/tests/generator/test_utilities.hpp +++ b/tests/generator/test_utilities.hpp @@ -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 > 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) { @@ -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