blob: 9d58e58b75b65908957f01008ed98cd8f1c6b811 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package com.yahoo.nativec;
import com.sun.jna.Platform;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
public class MallInfoTestCase {
@Test
public void requireThatMallInfo2IsDetected() {
if (Platform.isLinux()) {
GLibcVersion version = new GLibcVersion();
if ((version.major() >= 3) || ((version.major() == 2) && (version.minor() >= 33))) {
assertNull(MallInfo2.init());
}
} else {
assertEquals("Platform is unsupported. Only supported on Linux.", MallInfo2.init().getMessage());
}
}
@Test
public void requireThatMallInfoIsDetected() {
if (Platform.isLinux()) {
assertNull(MallInfo.init());
} else {
assertEquals("Platform is unsupported. Only supported on Linux.", MallInfo.init().getMessage());
}
}
}
|