35#include <gtest/gtest.h>
69 EXPECT_EQ(R.
cardinality(),
static_cast<size_t>(-1));
88 EXPECT_TRUE(strcmp(o.
str(),
"24/23") == 0);
89 std::cout <<
"a = ." << o.
str() <<
"." << std::endl;
92 EXPECT_EQ(R.
cardinality(),
static_cast<size_t>(-1));
98TEST(ARingQQGMP, arithmetic)
gmp_ZZ getRandomInteger()
void getElement< M2::ARingQQGMP >(const M2::ARingQQGMP &R, int index, M2::ARingQQGMP::ElementType &result)
void testAdd(const T &R, int ntrials)
void testNegate(const T &R, int ntrials)
void testReciprocal(const T &R, int ntrials)
void testCoercions(const T &R)
void testAxioms(const T &R, int ntrials)
void testSubtract(const T &R, int ntrials)
void testMultiply(const T &R, int ntrials)
std::string ringName(const T &R)
Shared gtest harness for the ARing*Test.cpp suite.
M2::ARingQQGMP — arbitrary-precision rationals backed straight by GMP mpq_t.
void nextElement(typename RingType::ElementType &result)
size_t cardinality() const
size_t characteristic() const
static void clear(ElementType &result)
void random(ElementType &result) const
void set_from_long(ElementType &result, long a) const
void divide(ElementType &result, const ElementType &a, const ElementType &b) const
test doc
void elem_text_out(buffer &o, const ElementType &a, bool p_one=true, bool p_plus=false, bool p_parens=false) const
void init(ElementType &result) const
wrapper for the gmp mpq_t integer representation
VALGRIND_MAKE_MEM_DEFINED & result(result)