29import org.jau.sys.PlatformProps;
30import org.jau.sys.MachineDataInfo;
31import org.jau.sys.RuntimeProps;
32import org.junit.Assert;
33import org.junit.FixMethodOrder;
35import org.junit.runners.MethodSorters;
37import jau.test.junit.util.JunitTracer;
39@FixMethodOrder(MethodSorters.NAME_ASCENDING)
45 System.err.print(PlatformProps.NEWLINE);
46 System.err.println(
"OS name/type: "+PlatformProps.os_name+
", "+PlatformProps.OS);
47 System.err.println(
"OS version: "+PlatformProps.os_version);
49 System.err.println(
"Arch, CPU: "+PlatformProps.os_arch+
", "+PlatformProps.CPU+
"/"+PlatformProps.CPU.family);
50 System.err.println(
"OS/Arch: "+PlatformProps.os_and_arch);
52 System.err.println(
"Java runtime: "+PlatformProps.JAVA_RUNTIME_NAME);
53 System.err.println(
"Java version, vm: "+PlatformProps.JAVA_VERSION_NUMBER);
55 System.err.println(
"MD.ST: "+PlatformProps.MACH_DESC_STAT);
56 System.err.println(
"MD.RT: "+RuntimeProps.MACH_DESC_RT);
63 final MachineDataInfo machine = PlatformProps.MACH_DESC_STAT;
64 final int ps = machine.pageSizeInBytes();
65 System.err.println(
"PageSize: "+ps);
66 Assert.assertTrue(
"PageSize is 0", 0 < ps );
68 final int ps_pages = machine.pageCount(ps);
69 Assert.assertTrue(
"PageNumber of PageSize is not 1, but "+ps_pages, 1 == ps_pages);
71 final int sz0 = ps - 10;
72 final int sz0_pages = machine.pageCount(sz0);
73 Assert.assertTrue(
"PageNumber of PageSize-10 is not 1, but "+sz0_pages, 1 == sz0_pages);
75 final int sz1 = ps + 10;
76 final int sz1_pages = machine.pageCount(sz1);
77 Assert.assertTrue(
"PageNumber of PageSize+10 is not 2, but "+sz1_pages, 2 == sz1_pages);
79 final int ps_psa = machine.pageAlignedSize(ps);
80 Assert.assertTrue(
"PageAlignedSize of PageSize is not PageSize, but "+ps_psa, ps == ps_psa);
82 final int sz0_psa = machine.pageAlignedSize(sz0);
83 Assert.assertTrue(
"PageAlignedSize of PageSize-10 is not PageSize, but "+sz0_psa, ps == sz0_psa);
85 final int sz1_psa = machine.pageAlignedSize(sz1);
86 Assert.assertTrue(
"PageAlignedSize of PageSize+10 is not 2*PageSize, but "+sz1_psa, ps*2 == sz1_psa);
89 public static void main(
final String args[]) {
91 org.junit.runner.JUnitCore.
main(tstname);