Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 34894c598c3c6f53dc95a053c328dc03c09303f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*******************************************************************************
 * Copyright (c) 2018 protos software gmbh (http://www.protos.de).
 * 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:
 * 		Henrik Rentz-Reichert (initial contribution)
 * 
 *******************************************************************************/

package org.eclipse.etrice.dctools.tests

interface TestConstants {
	
	static val TEST_STRING = "\"some test string\""
	static val TEST_C_COMMENT = "/* comment */"
	static val TEST_C_COMMENT2 = "/* comment\n\tnext line */"
	static val TEST_CPP_COMMENT = "// cpp comment"
	static val TEST_EMPTY_ROUND_BRACKET = "()"
	static val TEST_EMPTY_CURLY_BRACKET = "{}"
	static val TEST_EMPTY_SQUARE_BRACKET = "[]"
	static val CONTENTS1 = "/* comment */"
	static val CONTENTS2 = "/* another comment */"
	static val CONTENTS3 = "/* third comment */"
	static val TEST_EMPTY_ROUND_BRACKET_W_CONTENTS1 = "(" + CONTENTS1 + ")"
	static val TEST_NESTED_BRACKETS = "(" + CONTENTS1 + "(" + CONTENTS2 + ")" + CONTENTS3 + ")"
	static val TEST_IDENTIFIER = "someIdentifier_123_name"
	static val TEST_ARRAY_ACCESS = "array[]"
	static val TEST_OPERATION_CALL = "foo()"
	static val TEST_MEMBER_ACCESS = "field.member"
	static val TEST_ARRAY_MEMBER_ACCESS = "field[1+2].member"
	static val TEST_ARRAY_MEMBER_ACCESS_AND_CALL = TEST_ARRAY_MEMBER_ACCESS + ".op()"
	static val TEST_SPACIOUS_ARRAY_MEMBER_ACCESS_AND_CALL = "field [ 1 + 2 ]\n\t. member . op ( )"
	static val TEST_CODE = "DC var = new DC(); port.message(var);"
	static val TEST_CODE1 = "field.member1.member2[3].operation(x+4)"
	static val TEST_CODE2 = '''
			sendPort.ping(x /* comment */);
			ping.ping(1);
			// comment
			int local = 0;
			foo(foo(123+456+x)*2+foo(local));
			/* foo(i) */
			String t = "foo(i)";
		'''
	static val TEST_CODE3 = '''
			int result = 1;
			for (int i=0; i<10; ++i) {
				if (i>=5) {
					result = result * 3;
				}
				result = foo(result*2);
			}
		'''
	
	// incomplete sequences
	static val TEST_UNCLOSED_STRING = "\"the closing quotes are missing"
	static val TEST_UNCLOSED_BRACKETS = "(/* the closing round bracket is missing*/"
	static val TEST_UNCLOSED_NESTED_BRACKETS = "((/* nested */)/* the outer closing round bracket is missing*/"
	static val TEST_INCOMPLETE_FEATURE_CALL = "field.member."
}

Back to the top