Skip to content

Commit 3b990b8

Browse files
[Fix]: fix a test in tests/run.src/fundamental.at (#279)
1 parent d974e14 commit 3b990b8

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

tests/run.src/fundamental.at

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,22 +107,33 @@ AT_CHECK([${COMPILE} prog.cob], [1], [],
107107
AT_CLEANUP
108108

109109
AT_SETUP([Hexadecimal literal])
110-
AT_CHECK([${SKIP_TEST}])
111110

112-
AT_DATA([dump.c], [
113-
#include <stdio.h>
114-
int dump (unsigned char *data);
115-
int dump (unsigned char *data)
116-
{
117-
int i;
118-
for (i = 0; i < 4; i++)
119-
printf ("%02x", data[[i]]);
120-
puts ("");
121-
return 0;
111+
AT_DATA([dump.java], [
112+
import jp.osscons.opensourcecobol.libcobj.data.*;
113+
import jp.osscons.opensourcecobol.libcobj.call.*;
114+
115+
public class dump implements CobolRunnable {
116+
@Override
117+
public int run(CobolDataStorage... argStorages) {
118+
for(int i=0; i<3; ++i) {
119+
System.out.printf("%02x", argStorages@<:@0@:>@.getByte(i));
120+
}
121+
System.out.println("");
122+
return 0;
123+
}
124+
125+
@Override
126+
public void cancel() {
127+
}
128+
129+
@Override
130+
public boolean isActive() {
131+
return false;
132+
}
122133
}
123134
])
124135

125-
AT_CHECK([${CC} ${SHROPT} -o dump.${SHREXT} dump.c])
136+
AT_CHECK([javac dump.java])
126137

127138
AT_DATA([prog.cob], [
128139
IDENTIFICATION DIVISION.
@@ -138,7 +149,7 @@ AT_DATA([prog.cob], [
138149
AT_CHECK([${COMPILE} prog.cob])
139150
AT_CHECK([java prog], [0],
140151
[123
141-
00010200
152+
000102
142153
])
143154

144155
AT_CLEANUP

0 commit comments

Comments
 (0)