Macaulay2 Engine
Loading...
Searching...
No Matches
ARingQQFlintTest.cpp File Reference

gtest coverage for the FLINT-backed M2::ARingQQFlint rational aring. More...

#include <cstdio>
#include <string>
#include <iostream>
#include <sstream>
#include <memory>
#include <gtest/gtest.h>
#include <mpfr.h>
#include "aring-qq-flint.hpp"
#include "ARingTest.hpp"

Go to the source code of this file.

Functions

gmp_ZZ getRandomInteger ()
template<>
void getElement< M2::ARingQQFlint > (const M2::ARingQQFlint &R, int index, M2::ARingQQFlint::ElementType &result)
 TEST (ARingQQFlint, create)
 TEST (ARingQQFlint, display)
 TEST (ARingQQFlint, arithmetic)

Detailed Description

gtest coverage for the FLINT-backed M2::ARingQQFlint rational aring.

Note
AI-generated documentation. Verify against the source before relying on it.

Plugs M2::ARingQQFlint into the ARingTest.hpp harness via the getElement<M2::ARingQQFlint> specialisation: indices < 50 produce the deterministic [-25, 24] integer prefix (covering zero, plus / minus one, and small integer canonicalisations of fmpq_t), and the rest come from R.random(result) so the random source is the ring's own FLINT-backed draw. The standard testSomeMore battery then runs arithmetic, equality, inverse, and stream round-trips against the FLINT canonicalised representation.

Cross-checks against ARingQQGmpTest.cpp (same operations over GMP mpq_t) are the regression net the file-aring-zz-tests family relies on; a divergence between the two reveals a FLINT regression, a GMP edge case, or a wrapper bug. Historic catches include a fmpq_canonicalise sign bug on 0/-1.

See also
ARingTest.hpp
aring-qq-flint.hpp
ARingQQGmpTest.cpp
ARingZZTest.cpp

Definition in file ARingQQFlintTest.cpp.