@@ -46,38 +46,23 @@ TEST_FUNCTION_START(fmpz_mpoly_compose_fmpz_mpoly, state)
4646 if (fmpz_mpoly_compose_fmpz_mpoly (A , B , Cp , ctxB , ctxAC ) ||
4747 fmpz_mpoly_compose_fmpz_mpoly_horner (A1 , B , Cp , ctxB , ctxAC ) ||
4848 fmpz_mpoly_compose_fmpz_mpoly_geobucket (A2 , B , Cp , ctxB , ctxAC ))
49- {
50- printf ("FAIL\n" );
51- flint_printf ("Check non-example 1\n" , i );
52- fflush (stdout );
53- flint_abort ();
54- }
49+ TEST_FUNCTION_FAIL ("Check non-example 1\n" , i );
5550
5651 fmpz_mpoly_set_str_pretty (C + 0 , "x1" , NULL , ctxAC );
5752 fmpz_mpoly_set_str_pretty (C + 1 , "2*x2" , NULL , ctxAC );
5853 fmpz_mpoly_set_str_pretty (C + 2 , "1" , NULL , ctxAC );
5954 if (fmpz_mpoly_compose_fmpz_mpoly (A , B , Cp , ctxB , ctxAC ) ||
6055 fmpz_mpoly_compose_fmpz_mpoly_horner (A1 , B , Cp , ctxB , ctxAC ) ||
6156 fmpz_mpoly_compose_fmpz_mpoly_geobucket (A2 , B , Cp , ctxB , ctxAC ))
62- {
63- printf ("FAIL\n" );
64- flint_printf ("Check non-example 2\n" , i );
65- fflush (stdout );
66- flint_abort ();
67- }
57+ TEST_FUNCTION_FAIL ("Check non-example 2\n" , i );
6858
6959 fmpz_mpoly_set_str_pretty (C + 0 , "2*x1" , NULL , ctxAC );
7060 fmpz_mpoly_set_str_pretty (C + 1 , "x2" , NULL , ctxAC );
7161 fmpz_mpoly_set_str_pretty (C + 2 , "1" , NULL , ctxAC );
7262 if (!fmpz_mpoly_compose_fmpz_mpoly (A , B , Cp , ctxB , ctxAC ) ||
7363 !fmpz_mpoly_compose_fmpz_mpoly_horner (A1 , B , Cp , ctxB , ctxAC ) ||
7464 !fmpz_mpoly_compose_fmpz_mpoly_geobucket (A2 , B , Cp , ctxB , ctxAC ))
75- {
76- printf ("FAIL\n" );
77- flint_printf ("Check example 3\n" , i );
78- fflush (stdout );
79- flint_abort ();
80- }
65+ TEST_FUNCTION_FAIL ("Check example 3\n" , i );
8166
8267 /* Aliased generator composition */
8368 c = (slong * ) flint_malloc (nvarsB * sizeof (slong ));
@@ -186,24 +171,14 @@ TEST_FUNCTION_START(fmpz_mpoly_compose_fmpz_mpoly, state)
186171 if (!fmpz_mpoly_compose_fmpz_mpoly (A1 , B , C , ctxB , ctxAC ) ||
187172 !fmpz_mpoly_compose_fmpz_mpoly_horner (A2 , B , C , ctxB , ctxAC ) ||
188173 !fmpz_mpoly_compose_fmpz_mpoly_geobucket (A3 , B , C , ctxB , ctxAC ))
189- {
190- printf ("FAIL\n" );
191- flint_printf ("Check composition success with generators\n"
192- "i: %wd, j: %wd\n" , i , j );
193- fflush (stdout );
194- flint_abort ();
195- }
174+ TEST_FUNCTION_FAIL ("Check composition success with generators\n"
175+ "i: %wd, j: %wd\n" , i , j );
196176
197177 if (!fmpz_mpoly_equal (A , A1 , ctxAC ) ||
198178 !fmpz_mpoly_equal (A , A2 , ctxAC ) ||
199179 !fmpz_mpoly_equal (A , A3 , ctxAC ))
200- {
201- printf ("FAIL\n" );
202- flint_printf ("Check composition with generators\n"
203- "i: %wd, j: %wd\n" , i , j );
204- fflush (stdout );
205- flint_abort ();
206- }
180+ TEST_FUNCTION_FAIL ("Check composition with generators\n"
181+ "i: %wd, j: %wd\n" , i , j );
207182
208183 fmpz_mpoly_assert_canonical (A , ctxAC );
209184 fmpz_mpoly_assert_canonical (A1 , ctxAC );
@@ -264,24 +239,14 @@ TEST_FUNCTION_START(fmpz_mpoly_compose_fmpz_mpoly, state)
264239 !fmpz_mpoly_compose_fmpz_mpoly_geobucket (g2 , f , vals1 , ctx , ctx ) ||
265240 !fmpz_mpoly_equal (g , g1 , ctx ) ||
266241 !fmpz_mpoly_equal (g , g2 , ctx ))
267- {
268- printf ("FAIL\n" );
269- flint_printf ("Check composition success\ni: %wd\n" , i );
270- fflush (stdout );
271- flint_abort ();
272- }
242+ TEST_FUNCTION_FAIL ("Check composition success\ni: %wd\n" , i );
273243
274244 fmpz_mpoly_assert_canonical (g , ctx );
275245 fmpz_mpoly_assert_canonical (g1 , ctx );
276246 fmpz_mpoly_assert_canonical (g2 , ctx );
277247
278248 if (!fmpz_mpoly_equal (f , g , ctx ))
279- {
280- printf ("FAIL\n" );
281- flint_printf ("Check composition with identity\ni: %wd\n" , i );
282- fflush (stdout );
283- flint_abort ();
284- }
249+ TEST_FUNCTION_FAIL ("Check composition with identity\ni: %wd\n" , i );
285250
286251 fmpz_mpoly_clear (f , ctx );
287252 fmpz_mpoly_clear (g , ctx );
@@ -356,12 +321,7 @@ TEST_FUNCTION_START(fmpz_mpoly_compose_fmpz_mpoly, state)
356321 vals3 [v ] = (fmpz * ) flint_malloc (sizeof (fmpz ));
357322 fmpz_init (vals3 [v ]);
358323 if (!fmpz_mpoly_evaluate_all_fmpz (vals3 [v ], vals1 [v ], vals2 , ctx2 ))
359- {
360- printf ("FAIL\n" );
361- flint_printf ("Check evaluation success\ni: %wd\n" , i );
362- fflush (stdout );
363- flint_abort ();
364- }
324+ TEST_FUNCTION_FAIL ("Check evaluation success\ni: %wd\n" , i );
365325 }
366326
367327 fmpz_mpoly_randtest_bound (f , state , len1 , coeff_bits1 , exp_bound1 , ctx1 );
@@ -371,33 +331,18 @@ TEST_FUNCTION_START(fmpz_mpoly_compose_fmpz_mpoly, state)
371331 !fmpz_mpoly_compose_fmpz_mpoly_geobucket (g2 , f , vals1 , ctx1 , ctx2 ) ||
372332 !fmpz_mpoly_equal (g , g1 , ctx2 ) ||
373333 !fmpz_mpoly_equal (g , g2 , ctx2 ))
374- {
375- printf ("FAIL\n" );
376- flint_printf ("Check composition success\ni: %wd\n" , i );
377- fflush (stdout );
378- flint_abort ();
379- }
334+ TEST_FUNCTION_FAIL ("Check composition success\ni: %wd\n" , i );
380335
381336 fmpz_mpoly_assert_canonical (g , ctx2 );
382337 fmpz_mpoly_assert_canonical (g1 , ctx2 );
383338 fmpz_mpoly_assert_canonical (g2 , ctx2 );
384339
385340 if (!fmpz_mpoly_evaluate_all_fmpz (fe , f , vals3 , ctx1 ) ||
386341 !fmpz_mpoly_evaluate_all_fmpz (ge , g , vals2 , ctx2 ))
387- {
388- printf ("FAIL\n" );
389- flint_printf ("Check evaluation success\ni: %wd\n" , i );
390- fflush (stdout );
391- flint_abort ();
392- }
342+ TEST_FUNCTION_FAIL ("Check evaluation success\ni: %wd\n" , i );
393343
394344 if (!fmpz_equal (fe , ge ))
395- {
396- printf ("FAIL\n" );
397- flint_printf ("Check composition and evalall commute\ni: %wd\n" , i );
398- fflush (stdout );
399- flint_abort ();
400- }
345+ TEST_FUNCTION_FAIL ("Check composition and evalall commute\ni: %wd\n" , i );
401346
402347 for (v = 0 ; v < nvars1 ; v ++ )
403348 {
0 commit comments