Skip to content

Commit

Permalink
rename testing macro NMTOOLS_TESTING_DECLARE_NS to NMTOOLS_TESTING_US…
Browse files Browse the repository at this point in the history
…E_CASE
  • Loading branch information
alifahrri committed Jun 1, 2024
1 parent 86d539d commit a86fb6d
Show file tree
Hide file tree
Showing 598 changed files with 1,318 additions and 1,318 deletions.
10 changes: 5 additions & 5 deletions include/nmtools/testing/testing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,17 +307,17 @@ namespace nmtools::testing::data::function
#define NMTOOLS_GET_TESTING_DECLARE_CASE_MACRO(_1,_2,NAME,...) NAME
#define NMTOOLS_TESTING_DECLARE_CASE(...) NMTOOLS_GET_TESTING_DECLARE_CASE_MACRO(__VA_ARGS__, NMTOOLS_TESTING_DECLARE_CASE2, NMTOOLS_TESTING_DECLARE_CASE1)(__VA_ARGS__)

#define NMTOOLS_TESTING_DECLARE_NS1(ns) \
#define NMTOOLS_TESTING_USE_CASE1(ns) \
using namespace nmtools::testing::data::ns;

#define NMTOOLS_TESTING_DECLARE_NS2(ns1, ns2) \
#define NMTOOLS_TESTING_USE_CASE2(ns1, ns2) \
using namespace nmtools::testing::data::ns1::ns2;

#define NMTOOLS_TESTING_DECLARE_NS3(ns1, ns2, ns3) \
#define NMTOOLS_TESTING_USE_CASE3(ns1, ns2, ns3) \
using namespace nmtools::testing::data::ns1::ns2::ns3;

#define NMTOOLS_TESTING_DECLARE_NS_MACRO(_1,_2,_3,NAME,...) NAME
#define NMTOOLS_TESTING_DECLARE_NS(...) NMTOOLS_TESTING_DECLARE_NS_MACRO(__VA_ARGS__, NMTOOLS_TESTING_DECLARE_NS3, NMTOOLS_TESTING_DECLARE_NS2, NMTOOLS_TESTING_DECLARE_NS1)(__VA_ARGS__)
#define NMTOOLS_TESTING_USE_CASE_MACRO(_1,_2,_3,NAME,...) NAME
#define NMTOOLS_TESTING_USE_CASE(...) NMTOOLS_TESTING_USE_CASE_MACRO(__VA_ARGS__, NMTOOLS_TESTING_USE_CASE3, NMTOOLS_TESTING_USE_CASE2, NMTOOLS_TESTING_USE_CASE1)(__VA_ARGS__)

/**
* @brief helper macro to declare actual test data,
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/celu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN_celu_impl(__VA_ARGS__);
#define CELU_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, celu, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, celu, case_name); \
using namespace args; \
auto result = RUN_celu(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/elu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN_elu_impl(__VA_ARGS__);
#define ELU_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, elu, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, elu, case_name); \
using namespace args; \
auto result = RUN_elu(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/hardshrink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN_hardshrink_impl(__VA_ARGS__);
#define HARDSHRINK_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, hardshrink, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, hardshrink, case_name); \
using namespace args; \
auto result = RUN_hardshrink(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/hardswish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN_hardswish_impl(__VA_ARGS__);
#define HARDSWISH_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, hardswish, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, hardswish, case_name); \
using namespace args; \
auto result = RUN_hardswish(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/hardtanh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN_hardtanh_impl(__VA_ARGS__);
#define HARDTANH_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, hardtanh, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, hardtanh, case_name); \
using namespace args; \
auto result = RUN_hardtanh(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/leaky_relu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN_leaky_relu_impl(__VA_ARGS__);
#define LEAKY_RELU_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, leaky_relu, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, leaky_relu, case_name); \
using namespace args; \
auto result = RUN_leaky_relu(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/log_sigmoid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN_log_sigmoid_impl(__VA_ARGS__);
#define LOG_SIGMOID_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, log_sigmoid, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, log_sigmoid, case_name); \
using namespace args; \
auto result = RUN_log_sigmoid(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/mish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN_mish_impl(__VA_ARGS__);
#define MISH_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, mish, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, mish, case_name); \
using namespace args; \
auto result = RUN_mish(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/prelu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN_prelu_impl(__VA_ARGS__);
#define PRELU_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, prelu, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, prelu, case_name); \
using namespace args; \
auto result = RUN_prelu(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
4 changes: 2 additions & 2 deletions tests/array/array/activations/relu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ RUN_relu_impl(__VA_ARGS__);
#define RELU_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, relu, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, relu, case_name); \
using namespace args; \
auto result = RUN_relu(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand All @@ -70,7 +70,7 @@ SUBCASE(#case_name) \
#define CONSTEXPR_RELU_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, constexpr_relu, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, constexpr_relu, case_name); \
using namespace args; \
constexpr auto result = RUN_relu(case_name, __VA_ARGS__); \
NMTOOLS_STATIC_ASSERT_CLOSE( result, expect::result ); \
Expand Down
4 changes: 2 additions & 2 deletions tests/array/array/activations/relu6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ RUN_relu6_impl(__VA_ARGS__);
#define RELU6_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, relu6, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, relu6, case_name); \
using namespace args; \
auto result = RUN_relu6(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand All @@ -70,7 +70,7 @@ SUBCASE(#case_name) \
#define CONSTEXPR_RELU6_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, constexpr_relu6, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, constexpr_relu6, case_name); \
using namespace args; \
constexpr auto result = RUN_relu6(case_name, __VA_ARGS__); \
NMTOOLS_STATIC_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/selu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN_selu_impl(__VA_ARGS__);
#define SELU_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, selu, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, selu, case_name); \
using namespace args; \
auto result = RUN_selu(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/sigmoid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN_sigmoid_impl(__VA_ARGS__);
#define SIGMOID_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, sigmoid, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, sigmoid, case_name); \
using namespace args; \
auto result = RUN_sigmoid(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/silu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN_silu_impl(__VA_ARGS__);
#define SILU_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, silu, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, silu, case_name); \
using namespace args; \
auto result = RUN_silu(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/softplus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN_softplus_impl(__VA_ARGS__);
#define SOFTPLUS_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, softplus, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, softplus, case_name); \
using namespace args; \
auto result = RUN_softplus(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/softshrink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RUN_softshrink_impl(__VA_ARGS__);
#define SOFTSHRINK_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, softshrink, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, softshrink, case_name); \
using namespace args; \
auto result = RUN_softshrink(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/softsign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RUN_softsign_impl(__VA_ARGS__);
#define SOFTSIGN_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, softsign, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, softsign, case_name); \
using namespace args; \
auto result = RUN_softsign(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/activations/tanhshrink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN_tanhshrink_impl(__VA_ARGS__);
#define TANHSHRINK_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(activations, tanhshrink, case_name); \
NMTOOLS_TESTING_USE_CASE(activations, tanhshrink, case_name); \
using namespace args; \
auto result = RUN_tanhshrink(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/arange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN_arange_impl(__VA_ARGS__);
#define ARANGE_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(array, arange, case_name); \
NMTOOLS_TESTING_USE_CASE(array, arange, case_name); \
using namespace args; \
auto result = RUN_arange(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_EQUAL( nm::shape(result), expect::shape ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/atleast_1d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ inline auto name##_ls_db = nmtools::cast(name, nmtools::array::kind::ndarray_ls_
#define ATLEAST_1D_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(array, atleast_1d, case_name); \
NMTOOLS_TESTING_USE_CASE(array, atleast_1d, case_name); \
using namespace args; \
auto result = nmtools::array::atleast_1d(__VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/atleast_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ inline auto name##_ls_db = nmtools::cast(name, nmtools::array::kind::ndarray_ls_
#define ATLEAST_2D_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(array, atleast_2d, case_name); \
NMTOOLS_TESTING_USE_CASE(array, atleast_2d, case_name); \
using namespace args; \
auto result = nmtools::array::atleast_2d(__VA_ARGS__); \
NMTOOLS_ASSERT_EQUAL( nmtools::shape(result), expect::shape ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/atleast_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ inline auto name##_ls_db = nmtools::cast(name, nmtools::array::kind::ndarray_ls_
#define ATLEAST_3D_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(array, atleast_3d, case_name); \
NMTOOLS_TESTING_USE_CASE(array, atleast_3d, case_name); \
using namespace args; \
auto result = nmtools::array::atleast_3d(__VA_ARGS__); \
NMTOOLS_ASSERT_EQUAL( nmtools::dim(result), expect::dim ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/batch_norm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN_batch_norm_impl(__VA_ARGS__);
#define BATCH_NORM_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(array, batch_norm, case_name); \
NMTOOLS_TESTING_USE_CASE(array, batch_norm, case_name); \
using namespace args; \
auto result = RUN_batch_norm(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/broadcast_arrays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace view = nm::view;
#define BROADCAST_ARRAYS_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(broadcast_arrays, case_name); \
NMTOOLS_TESTING_USE_CASE(broadcast_arrays, case_name); \
using namespace args; \
const auto results = nmtools::array::broadcast_arrays(__VA_ARGS__); \
constexpr auto N = std::tuple_size_v<decltype(results)>; \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/broadcast_to.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace na = nm::array;
#define BROADCAST_TO_SUBCASE(case_name, expected, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(broadcast_to, case_name); \
NMTOOLS_TESTING_USE_CASE(broadcast_to, case_name); \
using namespace args; \
auto result = nmtools::array::broadcast_to(__VA_ARGS__); \
NMTOOLS_ASSERT_EQUAL( nmtools::shape(result), args::shape ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/compress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RUN_compress_impl(__VA_ARGS__);
#define COMPRESS_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(array, compress, case_name); \
NMTOOLS_TESTING_USE_CASE(array, compress, case_name); \
using namespace args; \
auto result = RUN_compress(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_EQUAL( nmtools::dim(result), nmtools::dim(expect::result) ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/concatenate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ RUN_impl(__VA_ARGS__);
#define CONCATENATE_SUBCASE(case_name, lhs, rhs, axis) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(view, concatenate, case_name); \
NMTOOLS_TESTING_USE_CASE(view, concatenate, case_name); \
auto array_ref = RUN_concatenate(case_name, args::lhs, args::rhs, args::axis); \
NMTOOLS_ASSERT_EQUAL( nm::shape(array_ref), expect::shape ); \
NMTOOLS_ASSERT_CLOSE( array_ref, expect::expected ); \
Expand Down
4 changes: 2 additions & 2 deletions tests/array/array/conv-1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ constexpr inline auto name##_ls_hb = nmtools::cast(name, nmtools::array::kind::n
#define CONV2D_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(array, conv2d, case_name); \
NMTOOLS_TESTING_USE_CASE(array, conv2d, case_name); \
using namespace args; \
auto result = nmtools::array::conv2d(__VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand All @@ -49,7 +49,7 @@ using nmtools::None;
#define CONSTEXPR_CONV2D_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(array, constexpr_conv2d, case_name); \
NMTOOLS_TESTING_USE_CASE(array, constexpr_conv2d, case_name); \
using namespace args; \
constexpr auto result = nmtools::view::conv2d( __VA_ARGS__); \
NMTOOLS_ASSERT_EQUAL( nmtools::shape(result), nmtools::shape(expect::result) ); \
Expand Down
4 changes: 2 additions & 2 deletions tests/array/array/conv-2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ constexpr inline auto name##_ls_hb = nmtools::cast(name, nmtools::array::kind::n
#define CONV2D_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(array, conv2d, case_name); \
NMTOOLS_TESTING_USE_CASE(array, conv2d, case_name); \
using namespace args; \
auto result = nmtools::view::conv2d(__VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand All @@ -49,7 +49,7 @@ using nmtools::None;
#define CONSTEXPR_CONV2D_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(array, constexpr_conv2d, case_name); \
NMTOOLS_TESTING_USE_CASE(array, constexpr_conv2d, case_name); \
using namespace args; \
constexpr auto result = RUN_conv2d(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_EQUAL( nmtools::shape(result), nmtools::shape(expect::result) ); \
Expand Down
4 changes: 2 additions & 2 deletions tests/array/array/conv-3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ constexpr inline auto name##_ls_hb = nmtools::cast(name, nmtools::array::kind::n
#define CONV2D_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(array, conv2d, case_name); \
NMTOOLS_TESTING_USE_CASE(array, conv2d, case_name); \
using namespace args; \
auto result = nmtools::view::conv2d(__VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand All @@ -49,7 +49,7 @@ using nmtools::None;
#define CONSTEXPR_CONV2D_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(array, constexpr_conv2d, case_name); \
NMTOOLS_TESTING_USE_CASE(array, constexpr_conv2d, case_name); \
using namespace args; \
constexpr auto result = RUN_conv2d(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_EQUAL( nmtools::shape(result), nmtools::shape(expect::result) ); \
Expand Down
4 changes: 2 additions & 2 deletions tests/array/array/conv-4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ constexpr inline auto name##_ls_hb = nmtools::cast(name, nmtools::array::kind::n
#define CONV2D_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(array, conv2d, case_name); \
NMTOOLS_TESTING_USE_CASE(array, conv2d, case_name); \
using namespace args; \
auto result = nmtools::view::conv2d(__VA_ARGS__); \
NMTOOLS_ASSERT_CLOSE( result, expect::result ); \
Expand All @@ -49,7 +49,7 @@ using nmtools::None;
#define CONSTEXPR_CONV2D_SUBCASE(case_name, ...) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(array, constexpr_conv2d, case_name); \
NMTOOLS_TESTING_USE_CASE(array, constexpr_conv2d, case_name); \
using namespace args; \
constexpr auto result = RUN_conv2d(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_EQUAL( nmtools::shape(result), nmtools::shape(expect::result) ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/cumprod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RUN_cumprod_impl(__VA_ARGS__);
SUBCASE(#case_name) \
{ \
/* using test case from accumulate_add since they're basically the same */ \
NMTOOLS_TESTING_DECLARE_NS(view, accumulate_multiply, case_name); \
NMTOOLS_TESTING_USE_CASE(view, accumulate_multiply, case_name); \
using namespace args; \
auto result = RUN_cumprod(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_EQUAL( nm::shape(result), expect::shape ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/cumsum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RUN_cumsum_impl(__VA_ARGS__);
SUBCASE(#case_name) \
{ \
/* using test case from accumulate_add since they're basically the same */ \
NMTOOLS_TESTING_DECLARE_NS(view, accumulate_add, case_name); \
NMTOOLS_TESTING_USE_CASE(view, accumulate_add, case_name); \
using namespace args; \
auto result = RUN_cumsum(case_name, __VA_ARGS__); \
NMTOOLS_ASSERT_EQUAL( nm::shape(result), expect::shape ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/expand_dims.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ RUN_impl(__VA_ARGS__);
#define EXPAND_DIMS_SUBCASE(case_name, array, axis) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(expand_dims, case_name); \
NMTOOLS_TESTING_USE_CASE(expand_dims, case_name); \
auto array_ref = RUN_expand_dims(case_name, args::array, args::axis); \
NMTOOLS_ASSERT_EQUAL( nm::shape(array_ref), expect::shape ); \
NMTOOLS_ASSERT_CLOSE( array_ref, expect::expected ); \
Expand Down
2 changes: 1 addition & 1 deletion tests/array/array/flatten.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ RUN_impl(__VA_ARGS__);
#define FLATTEN_SUBCASE(case_name, array) \
SUBCASE(#case_name) \
{ \
NMTOOLS_TESTING_DECLARE_NS(flatten,case_name); \
NMTOOLS_TESTING_USE_CASE(flatten,case_name); \
auto array_ref = RUN_flatten(case_name, args::array); \
NMTOOLS_ASSERT_EQUAL( nm::shape(array_ref), expect::shape ); \
NMTOOLS_ASSERT_CLOSE( array_ref, expect::expected ); \
Expand Down
Loading

0 comments on commit a86fb6d

Please sign in to comment.