package tests;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import util.PlatformSpecific;
import util.PlatformSpecific.Architecture;

public class PlatformSpecificTests {

    @Test
    public void testStringToArchitectureEnum() {
        assertEquals(Architecture.X86_64,
                     PlatformSpecific.getArchitectureFromString("blah x86_64 blah"));
        assertEquals(Architecture.I386,
                     PlatformSpecific.getArchitectureFromString("blah i386 blah"));
        assertEquals(Architecture.I686,
                     PlatformSpecific.getArchitectureFromString("blah i686 blah"));
        assertEquals(Architecture.UNKNOWN,
                     PlatformSpecific.getArchitectureFromString("blah blah blah"));
        assertEquals(Architecture.UNKNOWN,
                     PlatformSpecific.getArchitectureFromString(""));
        assertEquals(Architecture.UNKNOWN,
                     PlatformSpecific.getArchitectureFromString(null));
    }

}

@@ -53,16 +53,59 @@
 tEquals;
+%0Aimport static org.junit.Assert.assertTrue;
 %0A%0Aimport
@@ -1031,10 +1031,251 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void testGettingLinuxArchitecture() %7B%0A        if (PlatformSpecific.isOnLinux()) %7B%0A            assertTrue(PlatformSpecific.isOn32BitsLinux() %7C%7C%0A                       PlatformSpecific.isOn64BitsLinux());%0A        %7D%0A    %7D%0A%0A
 %7D%0A

Add test for getting linux kernel's architecture