/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6843578
* @summary Test IBM DB charsets
* @build IBM930_OLD IBM933_OLD IBM935_OLD IBM937_OLD IBM939_OLD IBM942_OLD IBM943_OLD IBM948_OLD IBM949_OLD IBM950_OLD IBM970_OLD IBM942C_OLD IBM943C_OLD IBM949C_OLD IBM1381_OLD IBM1383_OLD EUC_CN_OLD EUC_KR_OLD GBK_OLD Johab_OLD MS932_OLD MS936_OLD MS949_OLD MS950_OLD
* @run main TestIBMDB
*/
public class TestIBMDB {
static class Time {
long t;
}
throws Exception {
if (testDirect) {
} else {
}
for (int i = 0; i < iteration; i++) {
}
}
return cc;
}
throws Exception {
if (testDirect) {
} else {
}
for (int i = 0; i < iteration; i++) {
}
return cr;
}
throws Exception {
if (testDirect) {
} else {
}
for (int i = 0; i < iteration; i++) {
}
}
return bb;
}
throws Exception {
if (testDirect) {
} else {
}
for (int i = 0; i < iteration; i++) {
}
return cr;
}
for (byte b:bb)
}
// check and compare canEncoding/Encoding
throws Exception {
char[] cc = new char[0x10000];
int pos = 0;
for (char c = 0; c < 0xffff; c++) {
if (is970 && c == 0x2299)
continue;
if (canNew) {
printEntry(c, newCS);
} else {
if (is970) {
// we know 970 has bogus nnnn -> a2c1 -> 2299
continue;
}
}
printEntry(c, oldCS);
}
} else if (canNew) {
printEntry(c, newCS);
printEntry(c, oldCS);
} else {
}
}
}
}
}
}
// check and compare canEncoding/Encoding
throws Exception
{
//Try singlebyte first
byte[] bb = new byte[1];
for (int b = 0; b < 0x100; b++) {
bb[0] = (byte)b;
b& 0xff,
}
}
int b1Min = 0x40;
int b1Max = 0xfe;
if (!isEBCDIC) {
// decodable singlebyte b1
// only prints we are NOT expected. above two are known issue
b1 & 0xff,
continue;
}
}
}
if (isEBCDIC) {
} else {
}
//if (!sOld.equals(sNew)) {
continue; // known issude in old implementation
}
}
}
}
cs.newDecoder();
cs.newEncoder();
}
}
}
}
}
/* The first byte is the length of malformed bytes
byte[][] malformed = {
{5, (byte)0xF8, (byte)0x80, (byte)0x80, (byte)0x9F, (byte)0x80, (byte)0xC0 },
};
*/
throws Exception
{
boolean failed = false;
for (boolean direct: new boolean[] {false, true}) {
}
if (!cr.isMalformed()) {
System.out.printf(" FAIL(direct=%b): [%s] not malformed. -->cr=%s\n", direct, ashex, cr.toString());
failed = true;
failed = true;
}
}
}
if (failed)
}
if (direct) {
} else {
}
return false;
}
return true;
}
boolean failed = false;
//7f, a1a1, 8ea2a1a1, 8ea3a1a1, 8ea7a1a1
//0 1 2 3 7 11
int MAXOFF = 20;
int[][] Flows = {
//inpos, inLen, outPos, outLen, inPosEP, outposEP, under(0)/over(1)
//overflow
//underflow
};
for (boolean direct: new boolean[] {false, true}) {
failed = true;
}
}}}
if (failed)
}
"IBM930",
"IBM933",
"IBM935",
"IBM937",
"IBM939",
"IBM942",
"IBM943",
"IBM948",
"IBM949",
"IBM950",
"IBM970",
"IBM942C",
"IBM943C",
"IBM949C",
"IBM1381",
"IBM1383",
"EUC_CN",
"EUC_KR",
"GBK",
"Johab",
"MS932",
"MS936",
"MS949",
"MS950",
};
//ecdbic
checkMalformed(csNew, new byte[][] {
{1, 0x26, 0x0f, 0x27}, // in SBSC, no SI
{1, 0x0e, 0x41, 0x41, 0xe}, // in DBSC, no SO
{2, 0x0e, 0x40, 0x41, 0xe}, // illegal DB
});
//euc_simple
checkMalformed(csNew, new byte[][] {
{1, 0x26, (byte)0x8f, 0x27}, // SS2
{1, (byte)0xa1, (byte)0xa1, (byte)0x8e, 0x51}, // SS3
});
}
}
}
}