Browse Source

changed expectation on empty transition test (before: ignore, now:
always)

bohl 10 years ago
parent
commit
8b895f520a

+ 2 - 2
test-plugins/org.yakindu.sct.generator.c.test/gtests/EmptyTransition/EmptyTransition.cc

@@ -19,8 +19,8 @@ TEST(StatemachineTest, EmptyTransitionTest) {
 	emptyTransition_init(&handle);
 	emptyTransition_enter(&handle);
 	emptyTransition_runCycle(&handle);
-	EXPECT_TRUE(!emptyTransition_isStateActive(&handle, EmptyTransition_main_region_B));
-	EXPECT_TRUE(emptyTransition_isStateActive(&handle, EmptyTransition_main_region_A));
+	EXPECT_TRUE(emptyTransition_isStateActive(&handle, EmptyTransition_main_region_B));
+	EXPECT_TRUE(!emptyTransition_isStateActive(&handle, EmptyTransition_main_region_A));
 }
 
 		

+ 9 - 9
test-plugins/org.yakindu.sct.generator.c.test/test-gen/org/yakindu/sct/generator/c/test/EmptyTransition.java

@@ -1,13 +1,13 @@
 /**
- * Copyright (c) 2015 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
+* Copyright (c) 2015 committers of YAKINDU and others.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+*     committers of YAKINDU - initial API and implementation
+*/
 package org.yakindu.sct.generator.c.test;
 
 import java.util.Collection;

+ 2 - 2
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/EmptyTransitionTest/EmptyTransitionTest.cc

@@ -17,7 +17,7 @@ TEST(StatemachineTest, EmptyTransitionTest) {
 	statechart->init();
 	statechart->enter();
 	statechart->runCycle();
-	EXPECT_TRUE(!statechart->isStateActive(EmptyTransition::main_region_B));
-	EXPECT_TRUE(statechart->isStateActive(EmptyTransition::main_region_A));
+	EXPECT_TRUE(statechart->isStateActive(EmptyTransition::main_region_B));
+	EXPECT_TRUE(!statechart->isStateActive(EmptyTransition::main_region_A));
 	delete statechart;
 }

+ 9 - 9
test-plugins/org.yakindu.sct.generator.cpp.test/test-gen/org/yakindu/sct/generator/cpp/test/EmptyTransitionTest.java

@@ -1,13 +1,13 @@
 /**
- * Copyright (c) 2015 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
+* Copyright (c) 2015 committers of YAKINDU and others.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+*     committers of YAKINDU - initial API and implementation
+*/
 package org.yakindu.sct.generator.cpp.test;
 
 import java.util.Collection;

+ 9 - 11
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/emptytransition/EmptyTransitionStatemachine.java

@@ -1,8 +1,6 @@
 package org.yakindu.scr.emptytransition;
 
-public class EmptyTransitionStatemachine
-		implements
-			IEmptyTransitionStatemachine {
+public class EmptyTransitionStatemachine implements IEmptyTransitionStatemachine {
 
 	public enum State {
 		main_region_A, main_region_B, $NullState$
@@ -48,8 +46,8 @@ public class EmptyTransitionStatemachine
 	}
 
 	/** 
-	 * Always returns 'false' since this state machine can never become final.
-	 *
+	* Always returns 'false' since this state machine can never become final.
+	*
 	 * @see IStatemachine#isFinal() 
 	 */
 	@Override
@@ -58,21 +56,21 @@ public class EmptyTransitionStatemachine
 	}
 
 	/**
-	 * This method resets the incoming events (time events included).
-	 */
+	* This method resets the incoming events (time events included).
+	*/
 	protected void clearEvents() {
 
 	}
 
 	/**
-	 * This method resets the outgoing events.
-	 */
+	* This method resets the outgoing events.
+	*/
 	protected void clearOutEvents() {
 	}
 
 	/**
-	 * Returns true if the given state is currently active otherwise false.
-	 */
+	* Returns true if the given state is currently active otherwise false.
+	*/
 	public boolean isStateActive(State state) {
 		switch (state) {
 			case main_region_A :

+ 12 - 13
test-plugins/org.yakindu.sct.simulation.core.sexec.test/test-gen/org/yakindu/sct/simulation/core/sexec/test/EmptyTransitionTest.java

@@ -1,13 +1,13 @@
 /**
- * Copyright (c) 2015 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
+* Copyright (c) 2015 committers of YAKINDU and others.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+*     committers of YAKINDU - initial API and implementation
+*/
 package org.yakindu.sct.simulation.core.sexec.test;
 import org.eclipse.xtext.junit4.InjectWith;
 import org.eclipse.xtext.junit4.XtextRunner;
@@ -29,15 +29,14 @@ import static org.junit.Assert.assertTrue;
 public class EmptyTransitionTest extends AbstractExecutionFlowTest {
 	@Before
 	public void setup() throws Exception {
-		ExecutionFlow flow = models
-				.loadExecutionFlowFromResource("EmptyTransition.sct");
+		ExecutionFlow flow = models.loadExecutionFlowFromResource("EmptyTransition.sct");
 		initInterpreter(flow);
 	}
 	@Test
 	public void EmptyTransitionTest() throws Exception {
 		interpreter.enter();
 		interpreter.runCycle();
-		assertTrue(!isStateActive("B"));
-		assertTrue(isStateActive("A"));
+		assertTrue(isStateActive("B"));
+		assertTrue(!isStateActive("A"));
 	}
 }

+ 2 - 2
test-plugins/org.yakindu.sct.test.models/tests/EmptyTransition.sctunit

@@ -3,8 +3,8 @@ testgroup EmptyTransition for statechart EmptyTransition{
 	test EmptyTransitionTest { 
 		enter
 		cycle
-		assert !active (EmptyTransition.main_region.B)
-		assert active  (EmptyTransition.main_region.A) 
+		assert active (EmptyTransition.main_region.B)
+		assert !active  (EmptyTransition.main_region.A) 
 		 
 	} 
 }