
/*
 * Created on 23.08.2005
 */
package org.apache.harmony.test.func.api.java.lang.F_SystemTest_04;

import org.apache.harmony.test.func.share.ScenarioTest;

/**
 * Tests System.mapLibraryName(String) method.
 * 
 */
public class F_SystemTest_04 extends ScenarioTest {
    String libraryPrefix = "";
    String libraryExt;

    public static void main(String[] args) {
        System.exit(new F_SystemTest_04().test(args));
    }

    public int test() {
        if (System.getProperty("os.name").indexOf("Windows") == -1) {
            libraryPrefix = "lib";
            libraryExt = ".so";
        } else {
            libraryExt = ".dll";
        }
        String libraryName = "libc";
        if (System.mapLibraryName(libraryName).equals(
            libraryPrefix + libraryName + libraryExt)) {
            log.info("mapLibraryName(" + libraryName + ") = "
                + (libraryPrefix + libraryName + libraryExt));
            return pass();
        }
        return fail("Incorrect compared string in mapLibraryName method.");
    }
}