use compile time tests instead of runtime checks for skipping 64bit tests on 32bit integers

This commit is contained in:
Axel Kohlmeyer 2020-06-11 19:17:17 -04:00
parent 9ca0d01a5b
commit 1e8ef99fa7
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 24 additions and 6 deletions

View File

@ -42,45 +42,63 @@ TEST(FmtLib, insert_neg_int) {
}
TEST(FmtLib, insert_bigint) {
if (sizeof(bigint) == 4) GTEST_SKIP();
#if defined(LAMMPS_BIGBIG) || defined(LAMMPS_SMALLBIG)
const bigint val = 9945234592L;
auto text = fmt::format("word {}",val);
ASSERT_THAT(text, Eq("word 9945234592"));
#else
GTEST_SKIP();
#endif
}
TEST(FmtLib, insert_neg_bigint) {
if (sizeof(bigint) == 4) GTEST_SKIP();
#if defined(LAMMPS_BIGBIG) || defined(LAMMPS_SMALLBIG)
const bigint val = -9945234592L;
auto text = fmt::format("word {}",val);
ASSERT_THAT(text, Eq("word -9945234592"));
#else
GTEST_SKIP();
#endif
}
TEST(FmtLib, insert_tagint) {
if (sizeof(tagint) == 4) GTEST_SKIP();
#if defined(LAMMPS_BIGBIG)
const tagint val = 9945234592L;
auto text = fmt::format("word {}",val);
ASSERT_THAT(text, Eq("word 9945234592"));
#else
GTEST_SKIP();
#endif
}
TEST(FmtLib, insert_neg_tagint) {
if (sizeof(tagint) == 4) GTEST_SKIP();
#if defined(LAMMPS_BIGBIG)
const tagint val = -9945234592L;
auto text = fmt::format("word {}",val);
ASSERT_THAT(text, Eq("word -9945234592"));
#else
GTEST_SKIP();
#endif
}
TEST(FmtLib, insert_imageint) {
if (sizeof(imageint) == 4) GTEST_SKIP();
#if defined(LAMMPS_BIGBIG)
const imageint val = 9945234592L;
auto text = fmt::format("word {}",val);
ASSERT_THAT(text, Eq("word 9945234592"));
#else
GTEST_SKIP();
#endif
}
TEST(FmtLib, insert_neg_imageint) {
if (sizeof(imageint) == 4) GTEST_SKIP();
#if defined(LAMMPS_BIGBIG)
const imageint val = -9945234592L;
auto text = fmt::format("word {}",val);
ASSERT_THAT(text, Eq("word -9945234592"));
#else
GTEST_SKIP();
#endif
}
TEST(FmtLib, insert_double) {