I have a simple COBOL program (inside a Visual Cobol for Eclipse project), which calculates the maximum size of the binary gap and prints the result. Now I want to create a unit test and then modify the program so that the result is returned to the testing framework.
There is a unit test project in a separate directory. In Eclipse, the project structure looks like this:
This is the code of automatically generated unit test.
When I run it in Eclipse, I first get a Windows error message
Error when launching application (0xc0000142). To exit the application, press OK.
Thereafter the test is marked as "skipped":
After every run a file is created in COBOL-3\New_Configuration.bin
, e. g. 5872mfunit-state.dat
. It contains the following error message:
File COBOL-3\New_Configuration.bin\MFUT_TESTBINARYGAP-syserr.txt
is empty. COBOL-3\New_Configuration.bin\MFUT_TESTBINARYGAP-sysout.txt
contains the output of my program (as expected):
BIN-REP
00000100000000000000000000000000
CTR
06
CTR:
06
CTR:
05
CTR:
04
CTR:
03
CTR:
02
CTR:
01
MAX-GAP-SIZE:
00
File COBOL-3\New_Configuration.bin\COBOL-TEST.mfu
contains
[global]
fixture-filename=COBOL-TEST
preferred-cwd=C:\usr\dp\dev\java-mainframe\01-BinaryGap\COBOL-3\New_Configuration.bin
preferred-runner=mfurun
preferred-64bit-runner=true
isolate=true
report=noprintfile
report=nomarkdown
ignore-return-code=false
exit-code=true
cleanup=false
[MFUT_TESTBINARYGAP]
source.filename=C:\usr\dp\dev\java-mainframe\01-BinaryGap\COBOL-3\TestBinaryGap.cbl
source.lineno=17
source.seqfilename=C:\usr\dp\dev\java-mainframe\01-BinaryGap\COBOL-3\TestBinaryGap.cbl
source.seqno=172
collection.info=COBOL-TEST
setup=true
File COBOL-3\New_Configuration.bin\TestBinaryGap.obj.1.tlog
contains:
#"C:\PROGRA~2\Micro Focus\Visual COBOL\bin64\cobol.exe" C:\usr\dp\dev\java-mainframe\01-BinaryGap\COBOL-3\TestBinaryGap.cbl DELINT USEC:\usr\dp\dev\java-mainframe\01-BinaryGap\COBOL-3\New_Configuration.bin\mfant1904268475359773097.dir ;
^C:\usr\dp\dev\java-mainframe\01-BinaryGap\COBOL-3\TestBinaryGap.cbl
!C:\usr\dp\dev\java-mainframe\01-BinaryGap\COBOL-3\mfunit_prototypes.cpy
?C:\usr\dp\dev\java-mainframe\01-BinaryGap\COBOL-3\mfunit_prototypes.cpy
!$COBCPY\mfunit_prototypes.cpy
+"C:\Program Files (x86)\Micro Focus\Visual COBOL\cpylib\mfunit_prototypes.cpy"
!C:\usr\dp\dev\java-mainframe\01-BinaryGap\COBOL-3\mfunit.cpy
?C:\usr\dp\dev\java-mainframe\01-BinaryGap\COBOL-3\mfunit.cpy
!$COBCPY\mfunit.cpy
+"C:\Program Files (x86)\Micro Focus\Visual COBOL\cpylib\mfunit.cpy"
-"C:\Program Files (x86)\Micro Focus\Visual COBOL\cpylib\mfunit.cpy"
-"C:\Program Files (x86)\Micro Focus\Visual COBOL\cpylib\mfunit_prototypes.cpy"
!C:\usr\dp\dev\java-mainframe\01-BinaryGap\COBOL-3\mfunit.cpy
?C:\usr\dp\dev\java-mainframe\01-BinaryGap\COBOL-3\mfunit.cpy
!$COBCPY\mfunit.cpy
+"C:\Program Files (x86)\Micro Focus\Visual COBOL\cpylib\mfunit.cpy"
How can I fix this?
The goal is to create a minimal test (which may pass or fail, but doesn't crash like now) and then, gradually, add logic to it (it must be gradual because I'm not very experienced with COBOL).
Update 1: I changed the value of the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems\Windows
from
%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,20480,768 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=sxssrv,4 ProfileControl=Off MaxRequestThreads=16
to
%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,20480,1024 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=sxssrv,4 ProfileControl=Off MaxRequestThreads=16
The error persists.
Update 2: Information about the system.
Update 3: VMMAP output before running the test:
After the error message appears:
Update 4: JVM version seems to be 1.8.
Update 5: I changed the memory settings in the eclipse.ini
file so that it looks like this:
-startup
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.551.v20171108-1834
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-name
Visual COBOL
-feature
com.microfocus.eclipse.core.product
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.8
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Xms1024m
-Xmx2056m
-Dosgi.splashPath=platform:/base/plugins/com.microfocus.eclipse.core.win32
--add-modules=ALL-SYSTEM
--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED
-XX:+IgnoreUnrecognizedVMOptions
-DDSTORE_REMOTE_CLASS_LOADING_ON=true
-Denable.analysis=true