#include "test_helpers.h"
#include "fmpz.h"
#include "nf.h"
TEST_FUNCTION_START(nf_init_clear, state)
{
int i;
for (i = 0; i < 500 * flint_test_multiplier(); i++)
{
nf_t nf;
fmpq_poly_t pol;
fmpq_poly_init(pol);
do {
fmpq_poly_randtest_not_zero(pol, state,
2 + n_randint(state, 40),
10 + n_randint(state, 200));
} while (fmpq_poly_degree(pol) < 1);
nf_init(nf, pol);
nf_clear(nf);
nf_init(nf, pol);
fmpq_poly_clear(pol);
nf_clear(nf);
}
for (i = 0; i < 500 * flint_test_multiplier(); i++)
{
fmpq_poly_t pol;
nf_t nf;
fmpq_poly_init(pol);
do {
fmpq_poly_randtest_not_zero(pol, state,
2 + n_randint(state, 40),
10 + n_randint(state, 200));
} while (fmpq_poly_degree(pol) < 1);
fmpz_one(fmpq_poly_denref(pol));
fmpz_one(pol->coeffs + fmpq_poly_degree(pol));
nf_init(nf, pol);
nf_clear(nf);
nf_init(nf, pol);
fmpq_poly_clear(pol);
nf_clear(nf);
}
for (i = 0; i < 500 * flint_test_multiplier(); i++)
{
nf_t nf;
nf_init_randtest(nf, state,
2 + n_randint(state, 50),
1 + n_randint(state, 200));
nf_clear(nf);
nf_init_randtest(nf, state,
2 + n_randint(state, 50),
1 + n_randint(state, 200));
nf_clear(nf);
}
TEST_FUNCTION_END(state);
}