package mean;

import static org.junit.Assert.assertTrue;

import java.io.File;
import java.io.FileNotFoundException;

import org.junit.BeforeClass;
import org.junit.Test;

import config.Example;
import edu.udel.cis.vsl.tass.config.CompareConfiguration;
import edu.udel.cis.vsl.tass.front.minimp.ModelExtractor;
import edu.udel.cis.vsl.tass.front.minimp.ModelPair;
import edu.udel.cis.vsl.tass.model.IF.ModelIF;
import edu.udel.cis.vsl.tass.verify.Comparison;

public class MeanTest_LoopTest {
	private static ModelIF specModel, implModel;
	private static CompareConfiguration compareConfiguration;

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		ModelPair pair;
		File rootDirectory = new File(Example.exampleDirectory, "mean");

		compareConfiguration = new CompareConfiguration(new File(rootDirectory,
				"TASSREP"));
		compareConfiguration.setSpecSourceFile(new File(rootDirectory,
				"meanSpec.c"));
		compareConfiguration.setImplSourceFile(new File(rootDirectory,
				"meanImpl.c"));
		compareConfiguration.setSpecNumProcs(1);
		compareConfiguration.setImplNumProcs(1);
		compareConfiguration.setSpecModelName("meanSpec");
		compareConfiguration.setImplModelName("meanImpl");
		compareConfiguration.setLoopTechnique(true);
		compareConfiguration.setSimplify(true);
		pair = ModelExtractor.extractModelPair(compareConfiguration);
		specModel = pair.spec();
		implModel = pair.impl();
	}

	@Test
	public void testCompare() throws FileNotFoundException {
		assertTrue(Comparison.compare(specModel, implModel,
				compareConfiguration, true));
	}

}
