Skip to content

Commit

Permalink
test: Disable "constant overflow" MSVC warning
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jun 19, 2020
1 parent 8520da2 commit 3f8824e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions test/unittests/test_int128.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <intx/int128.hpp>
#include <test/utils/random.hpp>

#pragma warning(disable : 4307)

#define EXPECT_THROW_MESSAGE(stmt, ex_type, expected) \
try \
{ \
Expand Down
7 changes: 3 additions & 4 deletions test/unittests/test_intx_api.cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
// intx: extended precision integer library.
// Copyright 2019 Pawel Bylica.
// Copyright 2019-2020 Pawel Bylica.
// Licensed under the Apache License, Version 2.0.

#include "test_utils.hpp"
#include <gtest/gtest.h>
#include <intx/intx.hpp>

#pragma warning(disable : 4307)

using namespace intx;

static_assert(uint128{2} + uint128{2} == 4, "");
static_assert(uint256{2} + uint256{2} == 4, "");
static_assert(uint512{2} + uint512{2} == 4, "");

static_assert(uint128{2} - uint128{1} == 1, "");
#ifndef _MSC_VER
// FIXME: Investigate "integer constant overflow" issue on MSVC.
static_assert(uint256{2} - uint256{1} == 1, "");
static_assert(uint512{2} - uint512{1} == 1, "");
#endif

static_assert(constexpr_mul(uint128{2}, uint128{2}) == 4, "");
static_assert(constexpr_mul(uint256{2}, uint256{2}) == 4, "");
Expand Down

0 comments on commit 3f8824e

Please sign in to comment.