diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-04-26 15:17:53 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-04-26 15:17:53 +0200 |
commit | 077869e1bdf42433947b52d8787683ea431196ca (patch) | |
tree | a554ec3c25a49771914bbec4196b1d70836f1b12 /vespajlib/src/test | |
parent | be717cbb0d681e1e9d0afaf9d6321dc51e556932 (diff) |
Add MallInfo
Diffstat (limited to 'vespajlib/src/test')
-rw-r--r-- | vespajlib/src/test/java/com/yahoo/nativec/GlibCTestCase.java (renamed from vespajlib/src/test/java/com/yahoo/nativec/PosixFAdviseTestCase.java) | 13 | ||||
-rw-r--r-- | vespajlib/src/test/java/com/yahoo/nativec/MallInfoTestCase.java (renamed from vespajlib/src/test/java/com/yahoo/nativec/MallInfo2TestCase.java) | 10 |
2 files changed, 21 insertions, 2 deletions
diff --git a/vespajlib/src/test/java/com/yahoo/nativec/PosixFAdviseTestCase.java b/vespajlib/src/test/java/com/yahoo/nativec/GlibCTestCase.java index 8750dcb0a86..25ff67182f6 100644 --- a/vespajlib/src/test/java/com/yahoo/nativec/PosixFAdviseTestCase.java +++ b/vespajlib/src/test/java/com/yahoo/nativec/GlibCTestCase.java @@ -4,9 +4,10 @@ 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.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNull; -public class PosixFAdviseTestCase { +public class GlibCTestCase { @Test public void requireThatPosixFAdviseIsDetected() { if (Platform.isLinux()) { @@ -15,4 +16,14 @@ public class PosixFAdviseTestCase { assertEquals("Platform is unsúpported. Only supported on linux.", PosixFAdvise.init().getMessage()); } } + + @Test + public void requireGlibcVersionIsDetected() { + if (Platform.isLinux()) { + assertNull(GLibcVersion.init()); + assertNotEquals("", new GLibcVersion().version()); + } else { + assertEquals("Platform is unsúpported. Only supported on linux.", PosixFAdvise.init().getMessage()); + } + } } diff --git a/vespajlib/src/test/java/com/yahoo/nativec/MallInfo2TestCase.java b/vespajlib/src/test/java/com/yahoo/nativec/MallInfoTestCase.java index 87a92a2d640..378e994fe84 100644 --- a/vespajlib/src/test/java/com/yahoo/nativec/MallInfo2TestCase.java +++ b/vespajlib/src/test/java/com/yahoo/nativec/MallInfoTestCase.java @@ -6,7 +6,7 @@ import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -public class MallInfo2TestCase { +public class MallInfoTestCase { @Test public void requireThatMallInfo2IsDetected() { if (Platform.isLinux()) { @@ -15,4 +15,12 @@ public class MallInfo2TestCase { assertEquals("Platform is unsúpported. Only supported on linux.", MallInfo2.init().getMessage()); } } + @Test + public void requireThatMallInfoIsDetected() { + if (Platform.isLinux()) { + assertNull(MallInfo.init()); + } else { + assertEquals("Platform is unsúpported. Only supported on linux.", MallInfo.init().getMessage()); + } + } } |