Skip to content

Commit

Permalink
skip unit tests for trng::optimized_impl::uint128 if __SIZEOF_INT128_…
Browse files Browse the repository at this point in the history
…_ not defined
  • Loading branch information
rabauke committed Sep 2, 2024
1 parent bb7f1ea commit a58e64b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_uint128.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ struct pair {
};


#if defined __SIZEOF_INT128__
TEMPLATE_TEST_CASE("uint128 cast", "", trng::portable_impl::uint128, trng::optimized_impl::uint128) {
#else
TEMPLATE_TEST_CASE("uint128 cast", "", trng::portable_impl::uint128) {
#endif
SECTION("to uint64") {
using data_type = unary_op_tuple<TestType, std::uint64_t>;
// clang-format off
Expand Down Expand Up @@ -121,7 +125,11 @@ TEMPLATE_TEST_CASE("uint128 cast", "", trng::portable_impl::uint128, trng::optim
}


#if defined __SIZEOF_INT128__
TEMPLATE_TEST_CASE("uint128 math", "", trng::portable_impl::uint128, trng::optimized_impl::uint128) {
#else
TEMPLATE_TEST_CASE("uint128 math", "", trng::portable_impl::uint128) {
#endif
SECTION("arithmetic operators") {
SECTION("unary plus") {
using data_type = unary_op_tuple<TestType, TestType>;
Expand Down Expand Up @@ -300,7 +308,11 @@ TEMPLATE_TEST_CASE("uint128 math", "", trng::portable_impl::uint128, trng::optim
}


#if defined __SIZEOF_INT128__
TEMPLATE_TEST_CASE("uint128 comparison operators", "", trng::portable_impl::uint128, trng::optimized_impl::uint128) {
#else
TEMPLATE_TEST_CASE("uint128 comparison operators", "", trng::portable_impl::uint128) {
#endif
SECTION("less than") {
using data_type = pair<TestType, TestType>;
// clang-format off
Expand Down Expand Up @@ -368,7 +380,11 @@ TEMPLATE_TEST_CASE("uint128 comparison operators", "", trng::portable_impl::uint
}


#if defined __SIZEOF_INT128__
TEMPLATE_TEST_CASE("uint128 bitwise shift operators", "", trng::portable_impl::uint128, trng::optimized_impl::uint128) {
#else
TEMPLATE_TEST_CASE("uint128 bitwise shift operators", "", trng::portable_impl::uint128) {
#endif
SECTION("bitwise shift operators left") {
using data_type = binary_op_tuple<TestType, int, TestType>;
// clang-format off
Expand Down Expand Up @@ -424,7 +440,11 @@ TEMPLATE_TEST_CASE("uint128 bitwise shift operators", "", trng::portable_impl::u
}


#if defined __SIZEOF_INT128__
TEMPLATE_TEST_CASE("uint128 i/o operations", "", trng::portable_impl::uint128, trng::optimized_impl::uint128) {
#else
TEMPLATE_TEST_CASE("uint128 i/o operations", "", trng::portable_impl::uint128) {
#endif
SECTION("decimal output") {
using data_type = unary_op_tuple<TestType, std::string>;
// clang-format off
Expand Down

0 comments on commit a58e64b

Please sign in to comment.