1/* Licensed to the Apache Software Foundation (ASF) under one or more 2 * contributor license agreements. See the NOTICE file distributed with 3 * this work for additional information regarding copyright ownership. 4 * The ASF licenses this file to You under the Apache License, Version 2.0 5 * (the "License"); you may not use this file except in compliance with 6 * the License. You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package org.apache.harmony.tests.java.nio.charset; 18 19import java.io.UnsupportedEncodingException; 20import java.nio.ByteBuffer; 21import java.nio.charset.Charset; 22 23public class ASCCharsetDecoderTest extends CharsetDecoderTest { 24 25 protected void setUp() throws Exception { 26 cs = Charset.forName("ascii"); 27 super.setUp(); 28 } 29 30 /* 31 * @see CharsetDecoderTest#tearDown() 32 */ 33 protected void tearDown() throws Exception { 34 super.tearDown(); 35 } 36 37 // FIXME: give up this tests 38 // public void testDefaultCharsPerByte(){ 39 // // assertEquals(1, decoder.averageCharsPerByte()); 40 // // assertEquals(1, decoder.maxCharsPerByte()); 41 // assertEquals(decoder.averageCharsPerByte(), 1, 0.001); 42 // assertEquals(decoder.maxCharsPerByte(), 2, 0.001); 43 // } 44 45 ByteBuffer getUnmappedByteBuffer() { 46 // FIXME: different here 47 return null; 48 // ByteBuffer buffer = ByteBuffer.allocate(8); 49 // buffer.put((byte)-1); 50 // buffer.put(unibytes); 51 // buffer.flip(); 52 // return buffer; 53 54 } 55 56 ByteBuffer getMalformedByteBuffer() { 57 // FIXME: different here 58 ByteBuffer buffer = ByteBuffer.allocate(8); 59 buffer.put((byte) -1); 60 buffer.put(getByteBuffer()); 61 buffer.flip(); 62 return buffer; 63 64 // TODO: how malform? 65 // return null; 66 } 67 68 ByteBuffer getExceptionByteArray() throws UnsupportedEncodingException { 69 return null; 70 } 71 72} 73