package nsv3.assoc;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;

import java.io.File;
import java.io.IOException;

import org.junit.Test;

import config.Example;
import edu.udel.cis.vsl.tass.config.VerifyConfiguration;
import edu.udel.cis.vsl.tass.front.minimp.ModelExtractor;
import edu.udel.cis.vsl.tass.model.IF.ModelIF;
import edu.udel.cis.vsl.tass.util.SyntaxException;
import edu.udel.cis.vsl.tass.verify.Verification;

public class AssocTest {

	@Test
	public void assoc() throws IOException, SyntaxException {
		ModelIF model;
		File rootDirectory = new File(Example.exampleDirectory, "nsv3/assoc");
		VerifyConfiguration verifyConfiguration = new VerifyConfiguration(
				new File(rootDirectory, "TASSREP"));

		verifyConfiguration.setSourceFile(new File(rootDirectory, "assoc-tass.c"));
		verifyConfiguration.setModelName("assoc");
		verifyConfiguration.setNumProcs(1);
		verifyConfiguration.setVerbose(true);
		model = ModelExtractor.extractModel(verifyConfiguration);
		assertFalse(Verification.verify(model, verifyConfiguration, true));
	}
	
	@Test
	public void assoc2() throws IOException, SyntaxException {
		ModelIF model;
		File rootDirectory = new File(Example.exampleDirectory, "nsv3/assoc");
		VerifyConfiguration verifyConfiguration = new VerifyConfiguration(
				new File(rootDirectory, "TASSREP"));

		verifyConfiguration.setSourceFile(new File(rootDirectory, "assoc2-tass.c"));
		verifyConfiguration.setModelName("assoc");
		verifyConfiguration.setNumProcs(1);
		verifyConfiguration.setVerbose(true);
		model = ModelExtractor.extractModel(verifyConfiguration);
		assertTrue(Verification.verify(model, verifyConfiguration, true));
	}

}
