View Javadoc
1   /*
2    * Copyright 2022 The OSHI Project Contributors
3    * SPDX-License-Identifier: MIT
4    */
5   package oshi.driver.linux.proc;
6   
7   import static org.hamcrest.MatcherAssert.assertThat;
8   import static org.hamcrest.Matchers.greaterThan;
9   import static org.junit.jupiter.api.Assertions.assertNotNull;
10  
11  import java.util.Map;
12  
13  import org.junit.jupiter.api.Test;
14  import org.junit.jupiter.api.condition.EnabledOnOs;
15  import org.junit.jupiter.api.condition.OS;
16  
17  @EnabledOnOs(OS.LINUX)
18  class AuxvTest {
19      @Test
20      void testQueryAuxv() {
21          Map<Integer, Long> auxv = Auxv.queryAuxv();
22          assertNotNull("Aux vector should not be null");
23          assertThat("Clock Ticks should be positive", auxv.getOrDefault(Auxv.AT_CLKTCK, 0L), greaterThan(0L));
24          assertThat("Page Size should be positive", auxv.getOrDefault(Auxv.AT_PAGESZ, 0L), greaterThan(0L));
25      }
26  }