From 653e723132729b2c062481fbd76fca475e275f94 Mon Sep 17 00:00:00 2001 From: Lukas Cejka <lukas.ostatek@gmail.com> Date: Sat, 3 Nov 2018 17:53:02 +0100 Subject: [PATCH] In SparseMatrixTest.h: Create the testGetType and its corresponding gtest. --- src/UnitTests/Matrices/SparseMatrixTest.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/UnitTests/Matrices/SparseMatrixTest.h b/src/UnitTests/Matrices/SparseMatrixTest.h index 4eb836d93a..6f8fa52492 100644 --- a/src/UnitTests/Matrices/SparseMatrixTest.h +++ b/src/UnitTests/Matrices/SparseMatrixTest.h @@ -18,6 +18,28 @@ using CSR_cuda = TNL::Matrices::CSR< int, TNL::Devices::Cuda, int >; #ifdef HAVE_GTEST #include <gtest/gtest.h> +template< typename Matrix > +void testGetType() +{ + Matrix<float, TNL::Devices::Cuda, int> floatCudaMatrix; +// using CSR_host_getType = TNL::Matrices::CSR< float, TNL::Devices::Host, int> + Matrix<float, TNL::Devices::Host, int> floatHostMatrix; +// using CSR_cuda_getType = TNL::Matrices::CSR< float, TNL::Devices::Cuda, int> + EXPECT_EQ( floatCudaMatrix.getType(), "Matrices::CSR< float, Cuda >"); +} + +TEST( SparseMatrixTest, GetTypeTest ) +{ + testGetType< CSR_host >(); +} + +#ifdef HAVE_CUDA +TEST( SparseMatrixTest, GetTypeTest ) +{ + testGetType< CSR_cuda >(); +} +#endif + #endif #include "../GtestMissingError.h" -- GitLab