LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: ashish agarwal Date: Wed Jul 19 00:28:46 2006 Subject: Convert-IBM390-0.22 module
Hi,
I am working on Convert-IBM390-0.22 module for EBCDIC platform z/OS and
while doing gmake test I am getting 6 failures. Below are the results of
gmake test:
1..13
ok 1
asc2eb...........ok 2
expected: <>
actual: <>
...........not ok 3
expected: <KLMNOZ[\l|~[]A2>
actual: <KLMNOZ[\l|~½Ας
eb2asc...........ok 4
expected: <>
actual: <>
...........not ok 5
expected: <.<(+|!$*%@=[]A2>
actual: <.<(+|!$*%@=$) >
eb2ascp..........ok 6
expected: <>
actual: <>
..........not ok 7
expected: <.<(+|!$*%@=[]A2 >
actual: <KLMNOZ[\l|~[]A2 >
hexdump..........not ok 8
expected:
<f0f0f0f0f0f47a40f4c5f6c6f7f7f2f040f6f9f7f3f2f0f7f440f6f8f6f5f2f0f7>
actual:
<f0f0f0f0f0f47a40c4f5f9f6c1f6f4f040f8f9c1f2f4f0c1f340f8f8f8f5f4f0c1>
packeb...........not ok 9
expected:
<0000ffffc2f2f50000000000000089000088f30000fdf1008809b60131a6197fc4>
actual:
<0000ffff62cdcf0000000000000089000088f30000fdf1008809b60131a6197fc4>
unpackeb.........not ok 10
expected: <0 137 35059 65009 8915382 20031001 2143567890 -5 -39965439 0
137 3>
actual: <0 137 35059 65009 8915382 20031001 2143567890 -5 -39965439 0
137 3>
.........ok 11
packeb crash.....ok 12
.....ok 13
6 tests failed! There is no joy in Mudville.
So I investigated that testcases and there is difference between actual and
expected result. I debug the testcase "test.pl" and fixed testcase number 3,
5, 8.
This testcase(test 3) convert ASCII character to EBCDIC character. The
results were
expected: <KLMNOZ[\l|~[]A2>
actual: <KLMNOZ[\l|~½>
So I changed the string which is in red. Before it was like this
KLMNOZ[\\l|~\xAD\xBD\xC1\xF2
----- asc2eb
print "asc2eb...........";
my ($asc, $eb);
$asc = '';
$eb = asc2eb($asc);
was_it_ok(2, $eb , '');
print " ...........";
$asc = ".<(+|!\$*%\@=[]A2";
$eb = asc2eb($asc);
was_it_ok(3, $eb, "KLMNOZ[\\l|~\xCA\xB8\x65\xCD");
This testcase(test 5) convert EBCDIC character to ASCII character. The
results were
expected: <.<(+|!$*%@=[]A2>
actual: <.<(+|!$*%@=$) >
So I changed the string which is in red.Before it was like
thisKLMNOZ[\\l|~\xAD\xBD\xC1\xF2
#----- eb2asc
print "eb2asc...........";
$eb = "";
$asc = eb2asc($eb);
was_it_ok(4, $asc, "");
print " ...........";
$eb = "KLMNOZ[\\l|~\xCA\xB8\x65\xCD";
$asc = eb2asc($eb);
was_it_ok(5, $asc, ".<(+|!\$*%\@=[]A2");
This testcase(test8) convert string to code point hex.By default hexdump
takes the third argument ASCII which means use ASCII code page for
displaying printable character but for EBCDIC we need to provide the third
parameter.Before the expected string was
was_it_ok(8, $hdump[0],
"000004: *4E6F7720 69732074 68652074 696D6520 666F7220 616C6C20 676F6F64
20506*
*572 * *Now is the time for all good Per*\n");
So I changed it to below string in red.
#----- hexdump
print "hexdump..........";
my ($string, @hdump);
$string = "Now is the time for all good Perls to come to the aid of
their systems";
@hdump = hexdump($string, 4, ebcdic);
was_it_ok(8,$hdump[0],
"000004: D596A640 89A240A3
888540
A3 89948540 86969940 81939340 87969684 40D78599 *Now is the time for all
good
Per*\n");
print "hdump is $hdump[0]\n";
So I require your comments on the same, whether I am correct or not. Apart
from that I looked into testcase 9 and10, which are related to packeb and
unpackeb.
A).packeb takes a list of values and packs it into an EBCDIC record
(structure).
In testcase packeb function is opening *packtests* file and fetching data
from there. In this file it is checking for different options. It is failing
for below arguments which are in red. Packeb is unable to covert these
values into EBCDIC record.
packeb function: packeb($ptempl, @input)
s3@4 e3 (first arg)
0 -1 5 B25 (second arg)
0000FFFFC2F2F5 (result)
i9
0 137 35059 65009 8915382 20031001 2143567890 -5 -39965439
0000000000000089000088F30000FDF1008809B60131A6197FC44012FFFFFFFBFD9E2D01
s5S
0 137 32763 -5 -365 65534
000000897FFBFFFBFE93FFFE
i2s2
2147483647 -2147483648 32767 -32768
7FFFFFFF800000007FFF8000
e3xE3c2C*x3p2 p2p3.2z4P3h6t
A1 B2 g en 9 -9 98.79 -958 869 0FE9FA 1069774147
C1F10000C2F2406700656E000000009C009D09879CF0F9F5D800869F0FE9FA0055102C0103329F
B).unpackeb takes an EBCDIC record (structure) and unpacks it into a list of
values. In testcase packeb function is opening *unptests* file and fetching
data from there. In this file it is checking for different options. It is
failing for below arguments which are in red. unpackeb is unable to
covert EBCDIC
record into a list of values.
unpackeb function: unpackeb($utempl, $ebrecord)
i9
0000000000000089000088F30000FDF1008809B60131A6197FC44012FFFFFFFBFD9E2D01
0 137 35059 65009 8915382 20031001 2143567890 -5 -39965439
s5S
000000897FFBFFFBFE93FFFE
0 137 32763 -5 -365 65534
i2s2
7FFFFFFF800000007FFF8000
2147483647 -2147483648 32767 -32768
s3Si2I e2E4c2x3p2 p2p3.2z4v2h4t
0000FFFF0005FFFF00000000FFFFFFFEF0F0F0F0C1F1C2F34040325EF1405F
009C009D09879CF0F9F5D800000002E65A9C7A0055102C0103329F
0 -1 5 65535 0 -2 4042322160 A1 B3 2^ 9 -9 98.79 -958 W! 9c7a 1069774147
i9@4i3
0000000000000089000088F30000FDF1008809B60131A6197FC44012FFFFFFFBFD9E2D01
0 137 35059 65009 8915382 20031001 2143567890 -5 -39965439 137 35059 65009
Testcase 7 : I think here problem is not with testcase, eb2ascp function is
unable to print the character.
#----- eb2ascp
print "eb2ascp..........";
$eb = "";
$asc = eb2ascp($eb);
was_it_ok(6, $asc, "");
print " ..........";
$eb = "KLMNOZ[\\l|~\xAD\xBD\xC1\xF2\x00\xFE";
$asc = eb2ascp($eb);
was_it_ok(7, $asc, ".<(+|!\$*%\@=[]A2 ");
Please give your valuable input on all my observations.
Thanks a lot in advance.
Ashish Agarwal
Attachment: [text/html]
| Navigate in group perl.mvs at sever nntp.perl.org | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by PHP Developer
Powered By PHP Consultants |