Check-in [847b28b792]

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

Overview
Comment:Some MLE call corrections; Enable JUnit XML and HTML reports in the tests (if this has an effect).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wip-midlevel
Files: files | file ages | folders
SHA1: 847b28b792ef9537318af2288663ac3df4080316
User & Date: stephanie.gawroriski 2020-06-30 01:55:39
Context
2020-06-30
02:12
Fixes for Runtime and Terminal shelves. check-in: 468ce76e8f user: stephanie.gawroriski tags: wip-midlevel
01:55
Some MLE call corrections; Enable JUnit XML and HTML reports in the tests (if this has an effect). check-in: 847b28b792 user: stephanie.gawroriski tags: wip-midlevel
01:35
Throw the correct exception. check-in: c07a6ae36d user: stephanie.gawroriski tags: wip-midlevel
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to buildSrc/src/main/java/cc/squirreljme/plugin/tasks/TestInVMTask.java.

103
104
105
106
107
108
109







110
111
112
113
114
115
116
		// have when running the VMs especially when not fully stable
		this.testLogging(__settings ->
			{
				__settings.setShowCauses(true);
				__settings.setShowStandardStreams(true);
				__settings.setShowStackTraces(true);
			});







	}
	
	/**
	 * {@inheritDoc}
	 * @since 2020/03/06
	 */
	@Override







>
>
>
>
>
>
>







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
		// have when running the VMs especially when not fully stable
		this.testLogging(__settings ->
			{
				__settings.setShowCauses(true);
				__settings.setShowStandardStreams(true);
				__settings.setShowStackTraces(true);
			});
		
		// Make sure that both report types are enabled!
		this.reports(__reports ->
			{
				__reports.getJunitXml().setEnabled(true);
				__reports.getHtml().setEnabled(true);
			});
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2020/03/06
	 */
	@Override

Changes to emulators/springcoat-vm/src/main/java/cc/squirreljme/vm/springcoat/MLEObject.java.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
353
354
355
356
357
358
359



360
361
362
363
364
365
366
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.vm.springcoat;

import cc.squirreljme.jvm.mle.ObjectShelf;
import cc.squirreljme.jvm.mle.brackets.TypeBracket;
import cc.squirreljme.runtime.cldc.debug.Debugging;
import cc.squirreljme.vm.springcoat.brackets.TypeObject;
import cc.squirreljme.vm.springcoat.exceptions.SpringMLECallError;
import net.multiphasicapps.classfile.MethodDescriptor;

/**
 * Functions for {@link MLEObject}.
 *
 * @since 2020/06/18
................................................................................
		throws SpringMLECallError
	{
		// Wrong array type
		if (!__classy.isInstance(__src) ||
			!__classy.isInstance(__dest))
			throw new SpringMLECallError("Null array.");
		



		// Try to copy
		try
		{
			System.arraycopy(((SpringArrayObject)__src).array(), __srcOff,
				((SpringArrayObject)__dest).array(), __destOff, __len);
		}
		







<
<







 







>
>
>







7
8
9
10
11
12
13


14
15
16
17
18
19
20
...
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.vm.springcoat;

import cc.squirreljme.jvm.mle.ObjectShelf;
import cc.squirreljme.jvm.mle.brackets.TypeBracket;


import cc.squirreljme.vm.springcoat.exceptions.SpringMLECallError;
import net.multiphasicapps.classfile.MethodDescriptor;

/**
 * Functions for {@link MLEObject}.
 *
 * @since 2020/06/18
................................................................................
		throws SpringMLECallError
	{
		// Wrong array type
		if (!__classy.isInstance(__src) ||
			!__classy.isInstance(__dest))
			throw new SpringMLECallError("Null array.");
		
		if (__srcOff < 0 || __destOff < 0 || __len < 0)
			throw new SpringMLECallError("Negative offset or length.");
		
		// Try to copy
		try
		{
			System.arraycopy(((SpringArrayObject)__src).array(), __srcOff,
				((SpringArrayObject)__dest).array(), __destOff, __len);
		}
		

Changes to emulators/springcoat-vm/src/main/java/cc/squirreljme/vm/springcoat/MLETerminal.java.

7
8
9
10
11
12
13

14
15
16
17
18
19
20
..
75
76
77
78
79
80
81





82
83




84
85
86
87
88
89
90
91
92
93
94
95
96
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.vm.springcoat;

import cc.squirreljme.jvm.mle.TerminalShelf;
import cc.squirreljme.jvm.mle.constants.StandardPipeType;

import java.io.IOException;
import java.io.OutputStream;

/**
 * Functions for {@link MLETerminal}.
 *
 * @since 2020/06/18
................................................................................
		 * {@inheritDoc}
		 * @since 2020/06/18
		 */
		@SuppressWarnings("resource")
		@Override
		public Object handle(SpringThreadWorker __thread, Object... __args)
		{





			int len = (int)__args[3];
			




			try
			{
				MLETerminal.__fdOutput((int)__args[0])
					.write(((SpringArrayObjectByte)__args[1]).array(),
					(int)__args[2],
					len);
				return len;
			}
			catch (IllegalArgumentException|IOException e)
			{
				return -1;
			}
		}







>







 







>
>
>
>
>


>
>
>
>



|
<
<







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97


98
99
100
101
102
103
104
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.vm.springcoat;

import cc.squirreljme.jvm.mle.TerminalShelf;
import cc.squirreljme.jvm.mle.constants.StandardPipeType;
import cc.squirreljme.vm.springcoat.exceptions.SpringMLECallError;
import java.io.IOException;
import java.io.OutputStream;

/**
 * Functions for {@link MLETerminal}.
 *
 * @since 2020/06/18
................................................................................
		 * {@inheritDoc}
		 * @since 2020/06/18
		 */
		@SuppressWarnings("resource")
		@Override
		public Object handle(SpringThreadWorker __thread, Object... __args)
		{
			if (!(__args[1] instanceof SpringArrayObjectByte))
				throw new SpringMLECallError("Not a byte array.");
			
			SpringArrayObjectByte buf = (SpringArrayObjectByte)__args[1];
			int off = (int)__args[2];
			int len = (int)__args[3];
			
			// Perform basic bounds checking here
			if (off < 0 || len < 0 || (off + len) > buf.length)
				throw new SpringMLECallError("Index out of bounds.");
			
			try
			{
				MLETerminal.__fdOutput((int)__args[0])
					.write(buf.array(), off, len);


				return len;
			}
			catch (IllegalArgumentException|IOException e)
			{
				return -1;
			}
		}