Check-in [27ade338c0]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add test for intern strings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:27ade338c0f87763a7423b118fba4f813b8700c1
User & Date: stephanie.gawroriski 2019-05-24 13:30:05
Context
2019-05-24
13:32
Reduce String quick flag field size to short as not that many flags are needed. check-in: 09173c6844 user: stephanie.gawroriski tags: trunk
13:30
Add test for intern strings. check-in: 27ade338c0 user: stephanie.gawroriski tags: trunk
13:15
Move ApiLevel obtaining to the system call interface. check-in: 25c05490d0 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added runt/apis/cldc-compact.test/lang/TestStringIntern.in.

























>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
result: NoResult
thrown: NoExceptionThrown
secondary-cca: false
secondary-ccb: true
secondary-cna: false
secondary-cnb: false
secondary-cia: false
secondary-cib: true
secondary-cxa: false
secondary-cxb: true
secondary-iia: false
secondary-iib: true

Added runt/apis/cldc-compact.test/lang/TestStringIntern.java.



































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package lang;

import net.multiphasicapps.tac.TestRunnable;

/**
 * This tests that string interning works properly.
 *
 * @since 2019/05/24
 */
public class TestStringIntern
	extends TestRunnable
{
	/**
	 * {@inheritDoc}
	 * @since 2019/05/24
	 */
	@Override
	public void test()
	{
		this.secondary("cca", "squirrel" == "acorn");
		this.secondary("ccb", "squirrel" == "squirrel");
		
		this.secondary("cna", "squirrel" == new String("acorn"));
		this.secondary("cnb", "squirrel" == new String("squirrel"));
		
		this.secondary("cia", "squirrel" == "acorn".intern());
		this.secondary("cib", "squirrel" == "squirrel".intern());
		
		this.secondary("cxa",
			"squirrel" == new String("acorn").intern());
		this.secondary("cxb",
			"squirrel" == new String("squirrel").intern());
			
		this.secondary("iia", "squirrel".intern() ==
			new String("acorn").intern());
		this.secondary("iib", "squirrel".intern() ==
			new String("squirrel").intern());
	}
}