/*
* 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 7040220
*/
public class TestStringCodingUTF8 {
test();
// security manager on
test();
}
char[] bmp = new char[0x10000];
for (int i = 0; i < 0x10000; i++) {
bmp[i] = (char)i;
}
for (int i = 0; i < 0x20000; i++) {
}
int j = 0;
char[] bmpsupp = new char[0x30000];
for (int i = 0; i < 0x20000; i++) {
}
// randomed "off" and "len" on shuffled data
int maxlen = 1000;
int itr = 5000;
for (int i = 0; i < itr; i++) {
}
// random length of bytes, test the edge corner case
for (int i = 0; i < itr; i++) {
//new String(csn);
throw new RuntimeException("new String(csn) failed");
//new String(cs);
throw new RuntimeException("new String(cs) failed");
}
}
//getBytes(csn);
throw new RuntimeException("getBytes(csn) failed");
//getBytes(cs);
throw new RuntimeException("getBytes(cs) failed");
//new String(csn);
throw new RuntimeException("new String(csn) failed");
//new String(cs);
throw new RuntimeException("new String(cs) failed");
}
if (len == 0)
return ca;
.reset();
try {
if (!cr.isUnderflow())
cr.throwException();
if (!cr.isUnderflow())
cr.throwException();
} catch (CharacterCodingException x) {
throw new Error(x);
}
}
if (len == 0)
return ba;
.reset();
try {
if (!cr.isUnderflow())
cr.throwException();
if (!cr.isUnderflow())
cr.throwException();
} catch (CharacterCodingException x) {
throw new Error(x);
}
}
}
}