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 |
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 1 |
Complexity Density: 0.08 |
|
27 |
|
public class MathUtilsTest |
28 |
|
{ |
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 1 |
Complexity Density: 0.08 |
4-
|
|
29 |
0 |
@Test(groups = "Functional")... |
30 |
|
public void testGcd() |
31 |
|
{ |
32 |
0 |
assertEquals(MathUtils.gcd(0, 0), 0); |
33 |
0 |
assertEquals(MathUtils.gcd(0, 1), 1); |
34 |
0 |
assertEquals(MathUtils.gcd(1, 0), 1); |
35 |
0 |
assertEquals(MathUtils.gcd(1, 1), 1); |
36 |
0 |
assertEquals(MathUtils.gcd(1, -1), 1); |
37 |
0 |
assertEquals(MathUtils.gcd(-1, 1), 1); |
38 |
0 |
assertEquals(MathUtils.gcd(2, 3), 1); |
39 |
0 |
assertEquals(MathUtils.gcd(4, 2), 2); |
40 |
0 |
assertEquals(MathUtils.gcd(2, 4), 2); |
41 |
0 |
assertEquals(MathUtils.gcd(2, -4), 2); |
42 |
0 |
assertEquals(MathUtils.gcd(-2, 4), 2); |
43 |
0 |
assertEquals(MathUtils.gcd(-2, -4), 2); |
44 |
0 |
assertEquals(MathUtils.gcd(2 * 3 * 5 * 7 * 11, 3 * 7 * 13 * 17), 3 * 7); |
45 |
|
} |
46 |
|
} |