DASCA/com.logicalhacking.dasca.da.../src/test/java/com/logicalhacking/dasca/dataflow/test/Test01.java

58 lines
1.7 KiB
Java
Raw Normal View History

2015-06-14 07:04:57 +00:00
/*
2018-10-30 00:09:20 +00:00
* Copyright (c) 2010-2015 SAP SE.
* 2016-2018 The University of Sheffield.
*
2015-06-14 07:04:57 +00:00
* All rights reserved. This program and the accompanying materials
2018-10-30 00:09:20 +00:00
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
2015-06-14 07:04:57 +00:00
*
2018-10-30 00:09:20 +00:00
* SPDX-License-Identifier: EPL-2.0
2015-06-14 07:04:57 +00:00
*/
package com.logicalhacking.dasca.dataflow.test;
2015-06-14 07:04:57 +00:00
import static org.junit.Assert.assertEquals;
2016-08-23 12:46:28 +00:00
import java.io.IOException;
2016-08-28 14:51:55 +00:00
import org.junit.Before;
2015-06-14 07:04:57 +00:00
import org.junit.Test;
2016-08-28 14:51:55 +00:00
import com.ibm.wala.dataflow.IFDS.ICFGSupergraph;
2016-08-23 12:46:28 +00:00
import com.ibm.wala.util.CancelException;
import com.logicalhacking.dasca.dataflow.util.SuperGraphUtil;
2015-06-14 07:04:57 +00:00
public class Test01 {
String entryClass = "Test01";
2016-08-28 14:51:55 +00:00
@Before
2016-11-07 23:34:20 +00:00
public void initTest() throws IllegalArgumentException, CancelException, IOException {
TestSuite.initTestSG(entryClass);
2016-08-28 14:51:55 +00:00
}
2016-11-07 23:34:20 +00:00
2015-06-14 07:04:57 +00:00
@Test
public void testBad() throws IllegalArgumentException, CancelException, IOException {
2016-08-28 14:51:55 +00:00
int result = SuperGraphUtil.analyzeAndSaveSuperGraph(TestSuite.superGraph, entryClass, "bad");
2015-06-14 07:04:57 +00:00
assertEquals(1, result);
return;
}
@Test
public void testGood01() throws IllegalArgumentException, CancelException, IOException {
2016-08-28 14:51:55 +00:00
int result = SuperGraphUtil.analyzeAndSaveSuperGraph(TestSuite.superGraph, entryClass, "good01");
2015-06-14 07:04:57 +00:00
assertEquals(0, result);
return;
}
@Test
public void testGood02() throws IllegalArgumentException, CancelException, IOException {
2016-08-28 14:51:55 +00:00
int result = SuperGraphUtil.analyzeAndSaveSuperGraph(TestSuite.superGraph, entryClass, "good02");
assertEquals(-1, result);
2015-06-14 07:04:57 +00:00
return;
}
2016-11-07 23:34:20 +00:00
2015-06-14 07:04:57 +00:00
}