Unverified Commit 1e8ef99f authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

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

parent 9ca0d01a
Loading
Loading
Loading
Loading
+24 −6
Original line number Diff line number Diff line
@@ -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) {