Testing functional API only (oss/rotgen#17)
Co-authored-by: Jules Pénuchot <jules@penuchot.com> See merge request oss/rotgen!42
This commit is contained in:
parent
6fa95fb22d
commit
4a7aa08cdb
11 changed files with 192 additions and 192 deletions
|
|
@ -5,9 +5,11 @@
|
|||
SPDX-License-Identifier: BSL-1.0
|
||||
*/
|
||||
//==================================================================================================
|
||||
#include "unit/tests.hpp"
|
||||
#include <rotgen/rotgen.hpp>
|
||||
|
||||
#include "rotgen/functions/functions.hpp"
|
||||
#include "unit/tests.hpp"
|
||||
|
||||
void test_value(auto const& matrix,
|
||||
auto value,
|
||||
rotgen::Index i0,
|
||||
|
|
@ -57,7 +59,7 @@ TTS_CASE_TPL("Test dynamic block::setZero",
|
|||
rotgen::tests::prepare(rows, cols, fn, m);
|
||||
auto input = rotgen::extract(m, i0, j0, ni, nj);
|
||||
|
||||
input.setZero();
|
||||
rotgen::setZero(input);
|
||||
test_value(m, T{0}, i0, j0, ni, nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract(m, i0, j0, ni, nj));
|
||||
|
|
@ -66,7 +68,7 @@ TTS_CASE_TPL("Test dynamic block::setZero",
|
|||
}
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("Test static block:setZero",
|
||||
TTS_CASE_TPL("Test static block::setZero",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
{
|
||||
|
|
@ -80,7 +82,7 @@ TTS_CASE_TPL("Test static block:setZero",
|
|||
rotgen::tests::prepare(rows, cols, fn, m);
|
||||
auto input = rotgen::extract<D::ni, D::nj>(m, i0, j0);
|
||||
|
||||
input.setZero();
|
||||
rotgen::setZero(input);
|
||||
test_value(m, T{0}, i0, j0, D::ni, D::nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract<D::ni, D::nj>(m, i0, j0));
|
||||
|
|
@ -103,7 +105,7 @@ TTS_CASE_TPL("Test dynamic block::setOnes",
|
|||
rotgen::tests::prepare(rows, cols, fn, m);
|
||||
auto input = rotgen::extract(m, i0, j0, ni, nj);
|
||||
|
||||
input.setOnes();
|
||||
rotgen::setOnes(input);
|
||||
test_value(m, T{1}, i0, j0, ni, nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract(m, i0, j0, ni, nj));
|
||||
|
|
@ -112,7 +114,7 @@ TTS_CASE_TPL("Test dynamic block::setOnes",
|
|||
}
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("Test static block:setOnes",
|
||||
TTS_CASE_TPL("Test static block::setOnes",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
{
|
||||
|
|
@ -126,7 +128,7 @@ TTS_CASE_TPL("Test static block:setOnes",
|
|||
rotgen::tests::prepare(rows, cols, fn, m);
|
||||
auto input = rotgen::extract<D::ni, D::nj>(m, i0, j0);
|
||||
|
||||
input.setOnes();
|
||||
rotgen::setOnes(input);
|
||||
test_value(m, T{1}, i0, j0, D::ni, D::nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract<D::ni, D::nj>(m, i0, j0));
|
||||
|
|
@ -149,7 +151,7 @@ TTS_CASE_TPL("Test dynamic block::setConstant",
|
|||
rotgen::tests::prepare(rows, cols, fn, m);
|
||||
auto input = rotgen::extract(m, i0, j0, ni, nj);
|
||||
|
||||
input.setConstant(T{13.37f});
|
||||
rotgen::setConstant(input, T{13.37f});
|
||||
test_value(m, T{13.37f}, i0, j0, ni, nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract(m, i0, j0, ni, nj));
|
||||
|
|
@ -158,7 +160,7 @@ TTS_CASE_TPL("Test dynamic block::setConstant",
|
|||
}
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("Test static block:setConstant",
|
||||
TTS_CASE_TPL("Test static block::setConstant",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
{
|
||||
|
|
@ -172,7 +174,7 @@ TTS_CASE_TPL("Test static block:setConstant",
|
|||
rotgen::tests::prepare(rows, cols, fn, m);
|
||||
auto input = rotgen::extract<D::ni, D::nj>(m, i0, j0);
|
||||
|
||||
input.setConstant(T{13.37f});
|
||||
rotgen::setConstant(input, T{13.37f});
|
||||
test_value(m, T{13.37f}, i0, j0, D::ni, D::nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract<D::ni, D::nj>(m, i0, j0));
|
||||
|
|
@ -195,7 +197,7 @@ TTS_CASE_TPL("Test dynamic block::setIdentity",
|
|||
rotgen::tests::prepare(rows, cols, fn, m);
|
||||
auto input = rotgen::extract(m, i0, j0, ni, nj);
|
||||
|
||||
input.setIdentity();
|
||||
rotgen::setIdentity(input);
|
||||
test_identity(m, i0, j0, ni, nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract(m, i0, j0, ni, nj));
|
||||
|
|
@ -204,7 +206,7 @@ TTS_CASE_TPL("Test dynamic block::setIdentity",
|
|||
}
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("Test static block:setIdentity",
|
||||
TTS_CASE_TPL("Test static block::setIdentity",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
{
|
||||
|
|
@ -218,7 +220,7 @@ TTS_CASE_TPL("Test static block:setIdentity",
|
|||
rotgen::tests::prepare(rows, cols, fn, m);
|
||||
auto input = rotgen::extract<D::ni, D::nj>(m, i0, j0);
|
||||
|
||||
input.setIdentity();
|
||||
rotgen::setIdentity(input);
|
||||
test_identity(m, i0, j0, D::ni, D::nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract<D::ni, D::nj>(m, i0, j0));
|
||||
|
|
@ -241,7 +243,7 @@ TTS_CASE_TPL("Test dynamic block::setRandom",
|
|||
rotgen::tests::prepare(rows, cols, fn, m);
|
||||
auto input = rotgen::extract(m, i0, j0, ni, nj);
|
||||
|
||||
input.setRandom();
|
||||
rotgen::setRandom(input);
|
||||
test_random(m, i0, j0, ni, nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract(m, i0, j0, ni, nj));
|
||||
|
|
@ -250,7 +252,7 @@ TTS_CASE_TPL("Test dynamic block::setRandom",
|
|||
}
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("Test static block:setRandom",
|
||||
TTS_CASE_TPL("Test static block::setRandom",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
{
|
||||
|
|
@ -264,7 +266,7 @@ TTS_CASE_TPL("Test static block:setRandom",
|
|||
rotgen::tests::prepare(rows, cols, fn, m);
|
||||
auto input = rotgen::extract<D::ni, D::nj>(m, i0, j0);
|
||||
|
||||
input.setRandom();
|
||||
rotgen::setRandom(input);
|
||||
test_random(m, i0, j0, D::ni, D::nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract<D::ni, D::nj>(m, i0, j0));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue