source: git/Tst/Short/bug_509.tst @ 71e8e1

spielwiese
Last change on this file since 71e8e1 was 71e8e1, checked in by Jakob Kroeker <kroeker@…>, 10 years ago
add test for 509
  • Property mode set to 100644
File size: 1.2 KB
Line 
1LIB "tst.lib";
2tst_init();
3
4LIB("primdecint.lib");
5
6ring rng=integer,( a,b,y(1),d ),dp;
7
8proc testRadicalZ()
9{
10    ring rng=integer,( a,b,y(1),d ),dp;
11    ideal j = 2*d,d^2,y(1)^2 - y(1)*d, b*y(1) - 2*d,  a*b + y(1)*d;
12    def result = Primdecint::radicalZ(j);
13}
14
15proc testRadicalZ_2()
16{
17    ring rng = integer,(a,b,c),dp;   
18    ideal i = a^2*b^4 + c^2-1,4*a^2*b^3;
19    def result = Primdecint::radicalZ(i);
20    ideal expectedResult = 2*c^ 2-2, 2*a*b, a*b^2*c-a*b^ 2+c^2-1,a^2*b^3+a*b*c+a*b;
21    ASSUME( 0, 0 == size(   reduce(result,std(expectedResult) )   ) );
22    ASSUME( 0, 0 == size(   reduce(expectedResult,std(result) )   ) );
23}
24
25// the test fails, if inside of radicalZ will be an infinite loop
26link l1 = "ssi:fork"; open(l1);
27
28write( l1, quote(testRadicalZ_2()) );
29waitfirst( list(l1), 2000); // waits 2 seconds.
30
31if (not (status(l1,"read")=="ready")) { ERROR("testRadicalZ_2 failed!"); }
32close(l1);
33kill l1;
34
35link l1 = "ssi:fork"; open(l1);
36
37write( l1, quote( testRadicalZ() ) );
38waitfirst( list(l1), 2000); // waits 2 seconds.
39
40if (not (status(l1,"read")=="ready")) { ERROR("radicalZ() probably ended in an infinite loop!"); }
41close(l1);
42kill l1;
43
44tst_status(1); $
45
Note: See TracBrowser for help on using the repository browser.