/*
* 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 6371437 6371422 6371416 6371619 5058184 6371431 6639450 6569191 6577466
@summary Check if the problems reported in above bugs have been fixed
*/
public class TestIBMBugs {
try {
} catch (CharacterCodingException e) { }
}
int errors = 0;
for (int i = 1; i < 0x1ffff; i++) {
if (i >= 0x1100 && i <= 0x11f9)
continue; //Dont try leading consonant, vowel and trailing
//consonant as a single char
char[] in = (i < 0x10000
? new char[] { (char)i }
: new char[] { (char)(0xd800 + ((i - 0x10000) >> 10)),
(char)(0xdc00 + ((i - 0x10000) & 0x3ff)) });
try {
errors++;
}
} catch (CharacterCodingException e) { }
}
if (errors > 0)
}
}
int errors = 0;
for (int i = 0xd800; i < 0xe000; i++) {
char[] in = new char[] { (char)i };
try {
errors++;
} catch (CharacterCodingException e) { }
}
if (errors > 0)
}
}
int errors = 0;
for (int b = 0x80; b < 0x100; b++)
if (!(b == 0x8e || // 0x8e is a SS2
(b >= 0x80 && b <= 0x8d) || (b >= 0x90 && b <= 0x9f))) {
try {
errors++;
}
} catch (CharacterCodingException e) { }
}
if (errors > 0)
}
int errors = 0;
for (int b = 0xa0; b < 0x100; b++) {
try {
errors++;
}
} catch (CharacterCodingException e) { }
}
if (errors > 0)
}
}
(byte)0x81, (byte)0xae,
(byte)0x81, (byte)0xaf,
(byte)0x81, (byte)0xb0,
(byte)0x85, (byte)0x81,
(byte)0x85, (byte)0x87,
(byte)0x85, (byte)0xe0,
(byte)0x85, (byte)0xf0 };
if (!"\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd"
.equals(s))
throw new Exception("Cp943 failed");
}
}
}
bug6577466();
// need to be tested before any other IBM949C test case
bug6639450();
bug6371437();
bug6371422();
bug6371416();
bug6371619();
bug6371431();
bug6569191();
}
}