1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.util; |
22 |
|
|
23 |
|
import static org.testng.Assert.assertEquals; |
24 |
|
|
25 |
|
import org.testng.annotations.Test; |
26 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 1 |
Complexity Density: 0.08 |
|
27 |
|
public class MathUtilsTest |
28 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 1 |
Complexity Density: 0.08 |
1PASS
|
|
29 |
1 |
@Test(groups = "Functional")... |
30 |
|
public void testGcd() |
31 |
|
{ |
32 |
1 |
assertEquals(MathUtils.gcd(0, 0), 0); |
33 |
1 |
assertEquals(MathUtils.gcd(0, 1), 1); |
34 |
1 |
assertEquals(MathUtils.gcd(1, 0), 1); |
35 |
1 |
assertEquals(MathUtils.gcd(1, 1), 1); |
36 |
1 |
assertEquals(MathUtils.gcd(1, -1), 1); |
37 |
1 |
assertEquals(MathUtils.gcd(-1, 1), 1); |
38 |
1 |
assertEquals(MathUtils.gcd(2, 3), 1); |
39 |
1 |
assertEquals(MathUtils.gcd(4, 2), 2); |
40 |
1 |
assertEquals(MathUtils.gcd(2, 4), 2); |
41 |
1 |
assertEquals(MathUtils.gcd(2, -4), 2); |
42 |
1 |
assertEquals(MathUtils.gcd(-2, 4), 2); |
43 |
1 |
assertEquals(MathUtils.gcd(-2, -4), 2); |
44 |
1 |
assertEquals(MathUtils.gcd(2 * 3 * 5 * 7 * 11, 3 * 7 * 13 * 17), 3 * 7); |
45 |
|
} |
46 |
|
} |