Browse Source

Share project "org.yakindu.sct.model.sexec.interpreter.test" into "https://svn.codespot.com/a/eclipselabs.org/yakindu"

Andreas Mülder 13 years ago
parent
commit
0b3fe7d5c6

+ 7 - 0
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/.classpath

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

+ 28 - 0
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/.project

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.yakindu.sct.model.sexec.interpreter.test</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

+ 8 - 0
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/.settings/org.eclipse.jdt.core.prefs

@@ -0,0 +1,8 @@
+#Mon Dec 05 10:59:47 CET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5

+ 15 - 0
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/META-INF/MANIFEST.MF

@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Interpreter Test Plugin
+Bundle-SymbolicName: org.yakindu.sct.model.sexec.interpreter.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: YAKINDU
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.xtext;bundle-version="2.0.0",
+ org.junit;bundle-version="4.8.2",
+ org.yakindu.sct.model.sexec;bundle-version="1.0.0",
+ org.yakindu.sct.simulation.core;bundle-version="1.0.0",
+ org.yakindu.sct.model.sexec.interpreter;bundle-version="1.0.0",
+ org.yakindu.sct.model.stext;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy

+ 4 - 0
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/build.properties

@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .

+ 142 - 0
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/src/org/yakindu/sct/model/sexec/interpreter/test/AbstractSTextTest.java

@@ -0,0 +1,142 @@
+package org.yakindu.sct.model.sexec.interpreter.test;
+
+import java.io.StringReader;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.ParserRule;
+import org.eclipse.xtext.XtextFactory;
+import org.eclipse.xtext.linking.ILinker;
+import org.eclipse.xtext.nodemodel.INode;
+import org.eclipse.xtext.parser.IParseResult;
+import org.eclipse.xtext.parser.IParser;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.resource.impl.ListBasedDiagnosticConsumer;
+import org.junit.After;
+import org.junit.Before;
+import org.yakindu.sct.model.sexec.interpreter.stext.StextStatementInterpreter;
+import org.yakindu.sct.model.sgraph.Scope;
+import org.yakindu.sct.model.sgraph.Statement;
+import org.yakindu.sct.model.stext.STextStandaloneSetup;
+import org.yakindu.sct.simulation.core.runtime.IExecutionContext;
+import org.yakindu.sct.simulation.core.runtime.impl.ExecutionContextImpl;
+import org.yakindu.sct.simulation.core.runtime.impl.ExecutionEvent;
+import org.yakindu.sct.simulation.core.runtime.impl.ExecutionVariable;
+
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+
+public class AbstractSTextTest {
+
+	@Inject
+	private IParser parser;
+	@Inject
+	private ILinker linker;
+	@Inject
+	private XtextResource resource;
+	@Inject 
+	private ExecutionContextImpl context;
+	@Inject
+	private StextStatementInterpreter interpreter;
+
+	protected static final class TestExecutionContext extends
+			ExecutionContextImpl {
+
+		public String lastProcedureId;
+
+		@Override
+		public void call(String procedureId) {
+			super.call(procedureId);
+			lastProcedureId = procedureId;
+		}
+	}
+
+	@Before
+	public void setup() {
+		Injector injector = new STextStandaloneSetup()
+				.createInjectorAndDoEMFRegistration();
+		injector.injectMembers(this);
+		initContext();
+	}
+
+	private void initContext() {
+		// "event abc operation foo() var myInt : integer var MyBool : boolean
+		// var myReal : real
+		ExecutionVariable myInt = new ExecutionVariable("myInt", Integer.class, 0);
+		context.declareVariable(myInt);
+		ExecutionVariable myBool = new ExecutionVariable("myBool", Boolean.class, false);
+		context.declareVariable(myBool);
+		ExecutionVariable myFloat = new ExecutionVariable("myFloat", Float.class, 0.0f);
+		context.declareVariable(myFloat);
+		ExecutionEvent event = new ExecutionEvent("abc", Integer.class);
+		context.declareEvent(event);
+	}
+
+	protected Object getBoolValue() {
+		return context.getVariable("myBool").getValue();
+	}
+
+	protected Object getIntValue() {
+		return context.getVariable("myInt").getValue();
+	}
+
+	protected Object getFloatValue() {
+		return context.getVariable("myFloat").getValue();
+	}
+
+	@After
+	public void tearDown() {
+		context = null;
+	}
+
+	protected EObject parseExpression(String expression, Scope context,
+			String ruleName) {
+		ParserRule parserRule = XtextFactory.eINSTANCE.createParserRule();
+		parserRule.setName(ruleName);
+		IParseResult result = parser.parse(parserRule, new StringReader(
+				expression));
+		EObject rootASTElement = result.getRootASTElement();
+		resource.getContents().add(rootASTElement);
+		if (context != null)
+			resource.getContents().add(context);
+		linker.linkModel(result.getRootASTElement(),
+				new ListBasedDiagnosticConsumer());
+		if (result.hasSyntaxErrors()) {
+			StringBuilder errorMessages = new StringBuilder();
+			Iterable<INode> syntaxErrors = result.getSyntaxErrors();
+			for (INode iNode : syntaxErrors) {
+				errorMessages.append(iNode.getSyntaxErrorMessage());
+				errorMessages.append("\n");
+			}
+			throw new RuntimeException(
+					"Could not parse expression, syntax errors: "
+							+ errorMessages);
+		}
+		return rootASTElement;
+	}
+
+	protected Scope createContextScope(String contextScope) {
+		ParserRule parserRule = XtextFactory.eINSTANCE.createParserRule();
+		parserRule.setName("SimpleScope");
+		IParseResult result = parser.parse(parserRule, new StringReader(
+				contextScope));
+		return (Scope) result.getRootASTElement();
+	}
+
+	protected Object executeWithDefaultScope(String expression) {
+		Scope defaultScope = createContextScope("event abc : integer operation foo() var myInt : integer var myBool : boolean var myFloat : real");
+		Statement statement = (Statement) parseExpression(expression,
+				defaultScope, Statement.class.getSimpleName());
+		return interpreter.evaluateStatement(statement, context);
+	}
+
+	protected Object execute(String scope, String expression) {
+		Scope defaultScope = createContextScope(scope);
+		Statement statement = (Statement) parseExpression(expression,
+				defaultScope, Statement.class.getSimpleName());
+		return interpreter.evaluateStatement(statement, context);
+	}
+
+	public IExecutionContext getContext() {
+		return context;
+	}
+}

+ 628 - 0
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/src/org/yakindu/sct/model/sexec/interpreter/test/STextInterpreterTest.java

@@ -0,0 +1,628 @@
+/**
+ * Copyright (c) 2010 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.model.sexec.interpreter.test;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class STextInterpreterTest extends AbstractSTextTest {
+
+	@Test
+	public void testRaise() {
+		executeWithDefaultScope("raise abc");
+		assertTrue(getContext().getRaisedEvents().size() == 1);
+	}
+
+	@Test
+	public void testRaiseWithValue() {
+		executeWithDefaultScope("raise abc:42");
+		assertTrue(getContext().getRaisedEvents().size() == 1);
+		assertEquals(42, getContext().getRaisedEvents().get(0).getValue());
+	}
+
+//	@Test
+//	public void testProcedureCall() {
+//		executeWithDefaultScope("foo()");
+//		assertEquals("foo", getContext().lastProcedureId);
+//	}
+
+	@Test
+	public void testIntVariableAssignment() {
+		executeWithDefaultScope("myInt = 42");
+		assertEquals(42, getIntValue());
+	}
+
+	@Test
+	public void testHexVariableAssignment() {
+		executeWithDefaultScope("myInt = 0xFF");
+		assertEquals(0xFF, getIntValue());
+	}
+
+	@Test
+	public void testBoolTrueVariableAssignment() {
+		executeWithDefaultScope("myBool = true");
+		assertEquals(true, getBoolValue());
+	}
+
+	@Test
+	public void testBoolFalseVariableAssignment() {
+		executeWithDefaultScope("myBool = false");
+		assertEquals(false, getContext().getVariable("myBool")
+				.getValue());
+	}
+
+	@Test
+	public void testFloatVariableAssignment() {
+		executeWithDefaultScope("myFloat = 42.0");
+		assertEquals(42.0f, getContext().getVariable("myFloat")
+				.getValue());
+	}
+
+	//
+	// @Test
+	// public void testStringVariableAssignment() {
+	// executeWithDefaultScope("a = \"fortytwo\";");
+	// scope.addVariable(new RTVariable("a"));
+	// stmt.execute(scope);
+	//
+	// assertEquals("fortytwo", scope.getValue("a"));
+	// }
+	//
+	// @Test
+	// public void testIntStringVariableAssignment() {
+	// executeWithDefaultScope("a = \"42\";");
+	// scope.addVariable(new RTVariable("a"));
+	// stmt.execute(scope);
+	//
+	// assertEquals("42", scope.getValue("a"));
+	// }
+	//
+	@Test
+	public void testConditionalTrue() {
+		executeWithDefaultScope("myInt = true ? 42 : 1");
+		assertEquals(42, getIntValue());
+	}
+
+	@Test
+	public void testConditionalFalse() {
+		executeWithDefaultScope("myInt = false ? 42 : 1");
+		assertEquals(1, getIntValue());
+	}
+
+	@Test
+	public void testNestedExpression() {
+		executeWithDefaultScope("myInt = (1 + 1) * 2");
+		assertEquals(4, getIntValue());
+	}
+
+	@Test
+	public void testBooleanOr() {
+		executeWithDefaultScope("myBool = true || false");
+		assertEquals(true, getBoolValue());
+	}
+
+	@Test
+	public void testBooleanAnd() {
+		executeWithDefaultScope("myBool = true && false");
+		assertEquals(false, getContext().getVariable("myBool")
+				.getValue());
+	}
+
+	@Test
+	public void testBitwiseXor() {
+		executeWithDefaultScope("myInt = 0xF0F0 ^ 0xFF00");
+		assertEquals(0x0FF0, getContext().getVariable("myInt")
+				.getValue());
+
+	}
+
+	@Test
+	public void testBitwiseOr() {
+		executeWithDefaultScope("myInt = 0xF0F0 | 0xFFFF");
+		assertEquals(0xFFFF, getContext().getVariable("myInt")
+				.getValue());
+	}
+
+	@Test
+	public void testBitwiseAnd() {
+		executeWithDefaultScope("myInt = 0xF0F0 & 0xFFFF");
+		assertEquals(0x0F0F0, getContext().getVariable("myInt")
+				.getValue());
+	}
+
+	@Test
+	public void testBoolEqual() {
+		executeWithDefaultScope("myBool = false == false");
+		assertEquals(true, getBoolValue());
+	}
+
+	@Test
+	public void testIntEqual() {
+		executeWithDefaultScope("myBool = 1 == 1");
+		assertEquals(true, getBoolValue());
+	}
+
+	@Test
+	public void testFloatEqual() {
+		executeWithDefaultScope("myBool = 1.0f == 1.0f");
+		assertEquals(true, getBoolValue());
+	}
+
+	@Test
+	public void testBoolNotEqual() {
+		executeWithDefaultScope("myBool = true != false");
+		assertEquals(true, getBoolValue());
+	}
+
+	@Test
+	public void testIntNotEqual() {
+		executeWithDefaultScope("myBool = 1 != 2");
+		assertEquals(true, getBoolValue());
+	}
+
+	@Test
+	public void testFloatNotEqual() {
+		executeWithDefaultScope("myBool = 1.0f != 2.0f");
+		assertEquals(true, getBoolValue());
+	}
+
+	@Test
+	public void testIntGreaterEqual() {
+		executeWithDefaultScope("myBool = 2 >= 1");
+		assertEquals(true, getBoolValue());
+
+	}
+
+	@Test
+	public void testFloatGreaterEqual() {
+		executeWithDefaultScope("myBool = 2.0f >= 2.0f");
+		assertEquals(true, getBoolValue());
+	}
+
+	@Test
+	public void testIntSmallerEqual() {
+		executeWithDefaultScope("myBool = 1 <= 2");
+		assertEquals(true, getBoolValue());
+	}
+
+	@Test
+	public void testFloatSmallerEqual() {
+		executeWithDefaultScope("myBool = 2.0f <= 2.0f");
+		assertEquals(true, getBoolValue());
+	}
+
+	@Test
+	public void testIntGreater() {
+		executeWithDefaultScope("myBool = 2 > 1");
+		assertEquals(true, getBoolValue());
+	}
+
+	@Test
+	public void testFloatGreater() {
+		executeWithDefaultScope("myBool = 2.1f > 2.0f");
+		assertEquals(true, getBoolValue());
+	}
+
+	@Test
+	public void testIntSmaller() {
+		executeWithDefaultScope("myBool = 1 < 2");
+		assertEquals(true, getBoolValue());
+	}
+
+	@Test
+	public void testFloatSmaller() {
+		executeWithDefaultScope("myBool = 2.0f < 2.1f");
+		assertEquals(true, getBoolValue());
+	}
+
+	@Test
+	public void testIntPositive() {
+		executeWithDefaultScope("myInt = + 1");
+		assertEquals(1, getIntValue());
+		executeWithDefaultScope("myInt = +2");
+		assertEquals(2, getIntValue());
+	}
+
+	@Test
+	public void testFloatPositive() {
+		executeWithDefaultScope("myFloat = +1.0");
+		assertEquals(1.0f, getFloatValue());
+	}
+
+	@Test
+	public void testIntNegative() {
+		executeWithDefaultScope("myInt = - 1");
+		assertEquals(-1, getIntValue());
+		executeWithDefaultScope("myInt = -2");
+		assertEquals(-2, getIntValue());
+
+	}
+
+	// @Test
+	// public void testIntNegativeVar() {
+	// RTVariable a = new RTVariable("a");
+	// scope.addVariable(a);
+	// scope.setVariableValue(a, 42);
+	// executeWithDefaultScope("a = -a;");
+	// stmt.execute(scope);
+	//
+	// assertEquals(-42, scope.getValue("a"));
+	// }
+
+	@Test
+	public void testFloatNegative() {
+		executeWithDefaultScope("myFloat = -1.0f");
+		assertEquals(-1.0f, getFloatValue());
+	}
+
+	@Test
+	public void testIntPlus() {
+		executeWithDefaultScope("myInt = 42 + 1");
+		assertEquals(43, getIntValue());
+	}
+
+	@Test
+	public void testFloatPlus() {
+		executeWithDefaultScope("myFloat = 42.0 + 1.0");
+		assertEquals(43.0f, getFloatValue());
+	}
+
+	@Test
+	public void testIntMinus() {
+		executeWithDefaultScope("myInt = 42 - 1");
+		assertEquals(41, getIntValue());
+	}
+
+	@Test
+	public void testFloatMinus() {
+		executeWithDefaultScope("myFloat = 42.0f - 1.0f");
+		assertEquals(41.0f, getFloatValue());
+	}
+
+	@Test
+	public void testIntMultiply() {
+		executeWithDefaultScope("myInt = 42 * 2");
+		assertEquals(84, getIntValue());
+	}
+
+	@Test
+	public void testFloatMultiply() {
+		executeWithDefaultScope("myFloat = 42.0f * 2.0f");
+		assertEquals(84.0f, getFloatValue());
+	}
+
+	@Test
+	public void testIntDivide() {
+		executeWithDefaultScope("myInt = 42 / 2");
+		assertEquals(21, getIntValue());
+	}
+
+	@Test
+	public void testFloatDivide() {
+		executeWithDefaultScope("myFloat = 42.0f / 2.0f");
+		assertEquals(21.0f, getFloatValue());
+	}
+
+	@Test
+	public void testIntModulo() {
+		executeWithDefaultScope("myInt = 42 % 2");
+		assertEquals(0, getIntValue());
+	}
+
+	@Test
+	public void testFloatModulo() {
+		executeWithDefaultScope("myFloat = 42.0f % 2.0f");
+		assertEquals(0.0f, getFloatValue());
+	}
+
+	@Test
+	public void testIntLeft() {
+		executeWithDefaultScope("myInt = 42 << 2");
+		assertEquals(168, getIntValue());
+	}
+
+	// @Test
+	// public void testFloatLeft() {
+	// try {
+	// executeWithDefaultScope("a = 42.0f << 2.0f;");
+	// scope.addVariable(new RTVariable("a"));
+	// stmt.execute(scope);
+	//
+	// assertEquals(168, scope.getValue("a"));
+	// fail("EvaluationException expected");
+	// } catch (EvaluationException e) {
+	// }
+	// }
+
+	@Test
+	public void testIntRight() {
+		executeWithDefaultScope("myInt = 42 >> 2");
+		assertEquals(10, getIntValue());
+	}
+
+	// @Test
+	// public void testFloatRight() {
+	// try {
+	// executeWithDefaultScope("a = 42.0f >> 2.0f;");
+	// scope.addVariable(new RTVariable("a"));
+	// stmt.execute(scope);
+	//
+	// assertEquals(168, scope.getValue("a"));
+	// fail("EvaluationException expected");
+	// } catch (EvaluationException e) {
+	// }
+	// }
+
+	@Test
+	public void testIntAnd() {
+		executeWithDefaultScope("myInt= 9 & 12");
+		assertEquals(8, getIntValue());
+	}
+
+	//
+	// @Test
+	// public void testFloatAnd() {
+	// try {
+	// executeWithDefaultScope("a= 9.0f & 12.0f;");
+	// scope.addVariable(new RTVariable("a"));
+	// stmt.execute(scope);
+	//
+	// assertEquals(8.0f, scope.getValue("a"));
+	// fail("EvaluationException expected");
+	// } catch (EvaluationException e) {
+	// }
+	// }
+
+	@Test
+	public void testIntXor() {
+		executeWithDefaultScope("myInt= 9 ^ 12");
+		assertEquals(5, getIntValue());
+	}
+
+	// @Test
+	// public void testFloatXor() {
+	// try {
+	// executeWithDefaultScope("a= 9.0f ^ 12.0f;");
+	// scope.addVariable(new RTVariable("a"));
+	// stmt.execute(scope);
+	//
+	// assertEquals(5.0f, scope.getValue("a"));
+	// fail("EvaluationException expected");
+	// } catch (EvaluationException e) {
+	// }
+	// }
+
+	@Test
+	public void testIntOr() {
+		executeWithDefaultScope("myInt= 9 | 12");
+		assertEquals(13, getIntValue());
+	}
+
+	// @Test
+	// public void testFloatOr() {
+	// try {
+	// executeWithDefaultScope("a= 9.0f | 12.0f;");
+	// scope.addVariable(new RTVariable("a"));
+	// stmt.execute(scope);
+	//
+	// assertEquals(13.0f, scope.getValue("a"));
+	// fail("EvaluationException expected");
+	// } catch (EvaluationException e) {
+	// }
+	// }
+
+	@Test
+	public void testIntBitComplement() {
+		executeWithDefaultScope("myInt= ~9");
+		assertEquals(-10, getIntValue());
+	}
+
+	// @Test
+	// public void testFloatBitComplement() {
+	// try {
+	// executeWithDefaultScope("a= ~9.0f;");
+	// scope.addVariable(new RTVariable("a"));
+	// stmt.execute(scope);
+	//
+	// assertEquals(-10.0f, scope.getValue("a"));
+	// fail("EvaluationException expected");
+	// } catch (EvaluationException e) {
+	// }
+	// }
+
+	@Test
+	public void testNot() {
+		executeWithDefaultScope("myBool = ! true");
+		assertEquals(false, getBoolValue());
+	}
+
+	@Test
+	public void testPrirority() {
+		executeWithDefaultScope("myInt = 1 + 2 * 3");
+		assertEquals(7, getIntValue());
+	}
+
+	@Test
+	public void testNested() {
+		executeWithDefaultScope("myInt = (1 + 2) * 3");
+		assertEquals(9, getIntValue());
+	}
+
+	@Test
+	public void testIntPlusAssign() {
+		executeWithDefaultScope("myInt=42");
+		executeWithDefaultScope("myInt+=42");
+		assertEquals(84, getIntValue());
+	}
+
+	@Test
+	public void testFloatPlusAssign() {
+		executeWithDefaultScope("myFloat = 42.0");
+		System.out.println(getFloatValue());
+		executeWithDefaultScope("myFloat+=42.0");
+		assertEquals(84.0f, getFloatValue());
+	}
+
+	@Test
+	public void testIntMinusAssign() {
+		executeWithDefaultScope("myInt=42");
+		executeWithDefaultScope("myInt-=10");
+		assertEquals(32, getIntValue());
+	}
+
+	@Test
+	public void testFloatMinusAssign() {
+		executeWithDefaultScope("myFloat=42.0f");
+		executeWithDefaultScope("myFloat-=10.0");
+		assertEquals(32.0f, getFloatValue());
+	}
+
+	@Test
+	public void testIntMultAssign() {
+		executeWithDefaultScope("myInt=42");
+		executeWithDefaultScope("myInt*=1");
+		assertEquals(42, getIntValue());
+	}
+
+	@Test
+	public void testFloatMultAssign() {
+		executeWithDefaultScope("myFloat=42.0f");
+		executeWithDefaultScope("myFloat*=1.0");
+		assertEquals(42.0f, getFloatValue());
+	}
+
+	@Test
+	public void testIntDivAssign() {
+		executeWithDefaultScope("myInt=42");
+		executeWithDefaultScope("myInt/=1");
+		assertEquals(42, getIntValue());
+	}
+
+	@Test
+	public void testFloatDivAssign() {
+		executeWithDefaultScope("myFloat=42.0f");
+		executeWithDefaultScope("myFloat/=1.0f");
+		assertEquals(42.0f, getFloatValue());
+	}
+
+	@Test
+	public void testIntModAssign() {
+		executeWithDefaultScope("myInt=42");
+		executeWithDefaultScope("myInt%=1");
+		assertEquals(0, getIntValue());
+	}
+
+	@Test
+	public void testFloatModAssign() {
+		executeWithDefaultScope("myFloat=42.0f");
+		executeWithDefaultScope("myFloat%=1.0f");
+		assertEquals(0.0f, getFloatValue());
+	}
+
+	@Test
+	public void testIntLeftAssign() {
+		executeWithDefaultScope("myInt=42");
+		executeWithDefaultScope("myInt<<=1");
+		assertEquals(84, getIntValue());
+	}
+
+	// @Test
+	// public void testFloatLeftAssign() {
+	// try {
+	// executeWithDefaultScope("a=42.0f; a<<=1.0f;");
+	// scope.addVariable(new RTVariable("a"));
+	// stmt.execute(scope);
+	//
+	// assertEquals(168, scope.getValue("a"));
+	// fail("EvaluationException expected");
+	// } catch (EvaluationException e) {
+	// }
+	// }
+
+	// @Test
+	// public void testIntRightAssign() {
+	// executeWithDefaultScope("a=42; a>>=1;");
+	// assertEquals(21, scope.getValue("a"));
+	// }
+
+	// @Test
+	// public void testFloatRightAssign() {
+	// try {
+	// executeWithDefaultScope("a=42.0f; a>>=1.0f;");
+	// scope.addVariable(new RTVariable("a"));
+	// stmt.execute(scope);
+	//
+	// assertEquals(168, scope.getValue("a"));
+	// fail("EvaluationException expected");
+	// } catch (EvaluationException e) {
+	// }
+	// }
+	//
+	// @Test
+	// public void testIntAndAssign() {
+	// executeWithDefaultScope("a=9; a&=12;");
+	// assertEquals(8, scope.getValue("a"));
+	// }
+	//
+	// @Test
+	// public void testFloatAndAssign() {
+	// try {
+	// executeWithDefaultScope("a=42.0f; a&=1.0f;");
+	// scope.addVariable(new RTVariable("a"));
+	// stmt.execute(scope);
+	//
+	// assertEquals(168, scope.getValue("a"));
+	// fail("EvaluationException expected");
+	// } catch (EvaluationException e) {
+	// }
+	// }
+	//
+	// @Test
+	// public void testIntXorAssign() {
+	// executeWithDefaultScope("a=9; a^=12;");
+	// assertEquals(5, scope.getValue("a"));
+	// }
+
+	// @Test
+	// public void testFloatXorAssign() {
+	// try {
+	// executeWithDefaultScope("a=42.0f; a^=1.0f;");
+	// scope.addVariable(new RTVariable("a"));
+	// stmt.execute(scope);
+	//
+	// assertEquals(168, scope.getValue("a"));
+	// fail("EvaluationException expected");
+	// } catch (EvaluationException e) {
+	// }
+	// }
+	//
+	// @Test
+	// public void testIntOrAssign() {
+	// executeWithDefaultScope("a=9; a|=12;");
+	// assertEquals(13, scope.getValue("a"));
+	// }
+
+	// @Test
+	// public void testFloatOrAssign() {
+	// try {
+	// executeWithDefaultScope("a=42.0; a|=1.0;");
+	// scope.addVariable(new RTVariable("a"));
+	// stmt.execute(scope);
+	//
+	// assertEquals(168, scope.getValue("a"));
+	// fail("EvaluationException expected");
+	// } catch (EvaluationException e) {
+	// }
+	// }
+
+}