@Test
public void testRun() {

    int n;
    SmacAlgorithm smac = new SmacAlgorithm();
    // generate test arrays
    // --------------------
    float[] sza = new float[_vectorSize];
    float[] saa = new float[_vectorSize];
    float[] vza = new float[_vectorSize];
    float[] vaa = new float[_vectorSize];
    float[] taup550 = new float[_vectorSize];
    float[] uh2o = new float[_vectorSize];
    float[] uo3 = new float[_vectorSize];
    float[] pressure = new float[_vectorSize];
    float[] toa = new float[_vectorSize];
    float[] t_surf = new float[_vectorSize];
    boolean[] process = new boolean[_vectorSize];
    float invalid = 0.f;
    for (n = 0; n < _vectorSize; n++) {
        sza[n] = _defSza;
        saa[n] = _defSaa;
        vza[n] = _defVza;
        vaa[n] = _defVaa;
        taup550[n] = _defTaup550;
        uh2o[n] = _defUh2o;
        uo3[n] = _defUo3;
        pressure[n] = _defPressure;
        toa[n] = _defToa;
        process[n] = true;
    }
    try {
        SensorCoefficientFile file = new SensorCoefficientFile();
        String filePath = "../../src/org/esa/s3tbx/toolviews/smac/coefficients/";
        // loop over all sensor coefficient files and perform smac
        for (n = 0; n < _referenceCoeffs.length; n++) {
            file.readFile(filePath + _referenceCoeffs[n]);
            smac.setSensorCoefficients(file);
            t_surf = smac.run(sza, saa, vza, vaa, taup550, uh2o, uo3, pressure, process, invalid, toa, t_surf);
            assertEquals(_referenceCoeffs[n], _reference[n], t_surf[0], 1e-7f);
        }
        // check whether the process boolean array is working properly
        for (n = 0; n < _vectorSize; n++) {
            process[n] = false;
        }
        file.readFile(filePath + _referenceCoeffs[0]);
        smac.setSensorCoefficients(file);
        t_surf = smac.run(sza, saa, vza, vaa, taup550, uh2o, uo3, pressure, process, invalid, toa, t_surf);
        assertEquals(invalid, t_surf[0], 1e-7f);
    } catch (IOException ignored) {
    }
}