Skip to content

Commit

Permalink
safeguard more tests against slow calcium contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrik-johansson committed Jan 24, 2025
1 parent f9764e5 commit e4738ce
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/gr_poly/test/t-gcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "ulong_extras.h"
#include "gr_poly.h"

FLINT_DLL extern gr_static_method_table _ca_methods;

TEST_FUNCTION_START(gr_poly_gcd, state)
{
slong iter;
Expand All @@ -35,7 +37,7 @@ TEST_FUNCTION_START(gr_poly_gcd, state)
gr_poly_init(G, ctx);

n = 6;
if (ctx->which_ring == GR_CTX_CC_CA || ctx->which_ring == GR_CTX_RR_CA)
if (ctx->methods == _ca_methods)
n = 3;

status = gr_poly_randtest(A, state, n, ctx);
Expand Down
4 changes: 3 additions & 1 deletion src/gr_poly/test/t-gcd_euclidean.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "ulong_extras.h"
#include "gr_poly.h"

FLINT_DLL extern gr_static_method_table _ca_methods;

TEST_FUNCTION_START(gr_poly_gcd_euclidean, state)
{
slong iter;
Expand All @@ -35,7 +37,7 @@ TEST_FUNCTION_START(gr_poly_gcd_euclidean, state)
gr_poly_init(G, ctx);

n = 6;
if (ctx->which_ring == GR_CTX_CC_CA || ctx->which_ring == GR_CTX_RR_CA)
if (ctx->methods == _ca_methods)
n = 3;

status = gr_poly_randtest(A, state, n, ctx);
Expand Down
2 changes: 1 addition & 1 deletion src/gr_poly/test/t-resultant_hgcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ TEST_FUNCTION_START(gr_poly_resultant_hgcd, state)
cutoff1 = n_randint(state, 100);
cutoff2 = n_randint(state, 100);
}
else if (ctx->which_ring == GR_CTX_CC_CA || ctx->which_ring == GR_CTX_RR_CA)
else if (ctx->methods == _ca_methods)
{
n = n_randint(state, 3);
cutoff1 = n_randint(state, 3);
Expand Down
4 changes: 3 additions & 1 deletion src/gr_poly/test/t-xgcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "ulong_extras.h"
#include "gr_poly.h"

FLINT_DLL extern gr_static_method_table _ca_methods;

TEST_FUNCTION_START(gr_poly_xgcd, state)
{
int i;
Expand All @@ -33,7 +35,7 @@ TEST_FUNCTION_START(gr_poly_xgcd, state)

if (gr_ctx_is_finite(ctx) == T_TRUE && n_randint(state, 2) == 0)
n = 20;
else if (ctx->which_ring == GR_CTX_CC_CA || ctx->which_ring == GR_CTX_RR_CA)
else if (ctx->methods == _ca_methods)
n = 4;
else
n = 6;
Expand Down
4 changes: 3 additions & 1 deletion src/gr_poly/test/t-xgcd_euclidean.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "ulong_extras.h"
#include "gr_poly.h"

FLINT_DLL extern gr_static_method_table _ca_methods;

TEST_FUNCTION_START(gr_poly_xgcd_euclidean, state)
{
int i;
Expand All @@ -33,7 +35,7 @@ TEST_FUNCTION_START(gr_poly_xgcd_euclidean, state)

if (gr_ctx_is_finite(ctx) == T_TRUE && n_randint(state, 2) == 0)
n = 20;
else if (ctx->which_ring == GR_CTX_CC_CA || ctx->which_ring == GR_CTX_RR_CA)
else if (ctx->methods == _ca_methods)
n = 4;
else
n = 6;
Expand Down
4 changes: 3 additions & 1 deletion src/gr_poly/test/t-xgcd_hgcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "ulong_extras.h"
#include "gr_poly.h"

FLINT_DLL extern gr_static_method_table _ca_methods;

TEST_FUNCTION_START(gr_poly_xgcd_hgcd, state)
{
int i;
Expand All @@ -40,7 +42,7 @@ TEST_FUNCTION_START(gr_poly_xgcd_hgcd, state)
cutoff1 = n_randint(state, 100);
cutoff2 = n_randint(state, 100);
}
else if (ctx->which_ring == GR_CTX_CC_CA || ctx->which_ring == GR_CTX_RR_CA)
else if (ctx->methods == _ca_methods)
n = 4;
else
n = 6;
Expand Down

0 comments on commit e4738ce

Please sign in to comment.