summaryrefslogtreecommitdiffstats
path: root/libjava/testsuite/libjava.lang
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2006-06-27 20:38:10 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2006-06-27 20:38:10 +0000
commit0f25784615b45a02ab6e41b6d1354662f3799710 (patch)
tree4559b8284607c63eae3517638fbdf14bec92fafd /libjava/testsuite/libjava.lang
parentad8ae01eb762963f07a25de7eb2f8240c7f4032d (diff)
downloadppe42-gcc-0f25784615b45a02ab6e41b6d1354662f3799710.tar.gz
ppe42-gcc-0f25784615b45a02ab6e41b6d1354662f3799710.zip
* java/io/OutputStreamWriter.java (writeChars): Use a 'do' loop.
Set 'out.count' earlier. (close): Call setFinished on converter. (flush): Always write work buffer. * java/io/PrintStream.java (writeChars): Do 'do' loop. (close): Call setFinished on converter. Write a 'flush' array. * java/lang/natString.cc (getBytes): Call setFinished on converter. * gnu/gcj/convert/CharsetToBytesAdaptor.java (hasBytes): New field. (write): Set hasBytes. Changed 'finished' logic. (havePendingBytes): Rewrote. (setFinished): New method. * gnu/gcj/convert/UnicodeToBytes.java (setFinished): New method. * testsuite/libjava.lang/RH194522.java: New file. * testsuite/libjava.lang/RH194522.out: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115039 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/testsuite/libjava.lang')
-rw-r--r--libjava/testsuite/libjava.lang/RH194522.java18
-rw-r--r--libjava/testsuite/libjava.lang/RH194522.out0
2 files changed, 18 insertions, 0 deletions
diff --git a/libjava/testsuite/libjava.lang/RH194522.java b/libjava/testsuite/libjava.lang/RH194522.java
new file mode 100644
index 00000000000..5ea446cbd29
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/RH194522.java
@@ -0,0 +1,18 @@
+// Test case for http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=194522
+
+import java.io.*;
+import java.nio.charset.Charset;
+
+public class RH194522
+{
+ public static void main(String[] args) throws Exception
+ {
+ Charset c = Charset.forName("UTF-8");
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ PrintWriter pw = new PrintWriter(new OutputStreamWriter(baos, c));
+ pw.println("hi");
+ pw.println("bob");
+ pw.flush();
+ pw.close();
+ }
+}
diff --git a/libjava/testsuite/libjava.lang/RH194522.out b/libjava/testsuite/libjava.lang/RH194522.out
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/RH194522.out
OpenPOWER on IntegriCloud