diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/java.io/BufferedInputStreamTest.java | 6 | ||||
-rw-r--r-- | test/java.io/ByteArrayInputStreamTest.java | 6 | ||||
-rw-r--r-- | test/java.io/DataInputOutputTest.java | 94 | ||||
-rw-r--r-- | test/java.io/LineNumberInputStreamTest.java | 6 | ||||
-rw-r--r-- | test/java.io/PushbackInputStreamTest.java | 6 | ||||
-rw-r--r-- | test/java.io/SequenceInputStreamTest.java | 6 | ||||
-rw-r--r-- | test/java.io/StringBufferInputStreamTest.java | 6 |
7 files changed, 76 insertions, 54 deletions
diff --git a/test/java.io/BufferedInputStreamTest.java b/test/java.io/BufferedInputStreamTest.java index 5599ecae0..c38c179fc 100644 --- a/test/java.io/BufferedInputStreamTest.java +++ b/test/java.io/BufferedInputStreamTest.java @@ -1,11 +1,13 @@ /************************************************************************* /* BufferedInputStreamTest.java -- Tests BufferedInputStream's /* -/* Copyright (c) 1998 by Aaron M. Renn (arenn@urbanophile.com) +/* Copyright (c) 1998 Free Software Foundation, Inc. +/* Written by Aaron M. Renn (arenn@urbanophile.com) /* /* This program is free software; you can redistribute it and/or modify /* it under the terms of the GNU General Public License as published -/* by the Free Software Foundation, version 2. (see COPYING) +/* by the Free Software Foundation, either version 2 of the License, or +/* (at your option) any later version. /* /* This program is distributed in the hope that it will be useful, but /* WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/test/java.io/ByteArrayInputStreamTest.java b/test/java.io/ByteArrayInputStreamTest.java index 6c5841508..1e70c6af8 100644 --- a/test/java.io/ByteArrayInputStreamTest.java +++ b/test/java.io/ByteArrayInputStreamTest.java @@ -1,11 +1,13 @@ /************************************************************************* /* ByteArrayInputStreamTest.java -- Test ByteArrayInputStream's of course /* -/* Copyright (c) 1998 by Aaron M. Renn (arenn@urbanophile.com) +/* Copyright (c) 1998 Free Software Foundation, Inc. +/* Written by Aaron M. Renn (arenn@urbanophile.com) /* /* This program is free software; you can redistribute it and/or modify /* it under the terms of the GNU General Public License as published -/* by the Free Software Foundation, version 2. (see COPYING) +/* by the Free Software Foundation, either version 2 of the License, or +/* (at your option) any later version. /* /* This program is distributed in the hope that it will be useful, but /* WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/test/java.io/DataInputOutputTest.java b/test/java.io/DataInputOutputTest.java index b17609ef3..905efea5e 100644 --- a/test/java.io/DataInputOutputTest.java +++ b/test/java.io/DataInputOutputTest.java @@ -1,11 +1,13 @@ /************************************************************************* /* DataInputOutputTest.java -- Tests Data{Input,Output}Stream's /* -/* Copyright (c) 1998 by Aaron M. Renn (arenn@urbanophile.com) +/* Copyright (c) 1998 Free Software Foundation, Inc. +/* Written by Aaron M. Renn (arenn@urbanophile.com) /* /* This program is free software; you can redistribute it and/or modify /* it under the terms of the GNU General Public License as published -/* by the Free Software Foundation, version 2. (see COPYING) +/* by the Free Software Foundation, either version 2 of the License, or +/* (at your option) any later version. /* /* This program is distributed in the hope that it will be useful, but /* WITHOUT ANY WARRANTY; without even the implied warranty of @@ -24,47 +26,14 @@ import java.io.*; public class DataInputOutputTest { -public static void -main(String[] argv) +public static void +runReadTest(String filename, int seq, String testname) { - System.out.println("Started test of DataInputStream and DataOutputStream"); - try { - System.out.println("Test 1: DataOutputStream write test"); + System.out.println("Test " + seq + ": " + testname); - FileOutputStream fos = new FileOutputStream("dataoutput.out"); - DataOutputStream dos = new DataOutputStream(fos); - - dos.writeBoolean(true); - dos.writeBoolean(false); - dos.writeByte((byte)8); - dos.writeByte((byte)-122); - dos.writeChar((char)'a'); - dos.writeChar((char)'\uE2D2'); - dos.writeShort((short)32000); - dos.writeInt((int)8675309); - dos.writeLong((long)696969696969); - dos.writeFloat((float)3.1415); - dos.writeDouble((double)999999999.999); - dos.writeUTF("Testing code is such a boring activity but it must be done"); - dos.writeUTF("a-->\u01FF\uA000\u6666\u0200RRR"); - dos.close(); - - // We'll find out if this was really right later, but conditionally - // report success for now - System.out.println("PASSED: DataOutputStream write test"); - } - catch(IOException e) - { - System.out.println("FAILED: DataOutputStream write test: " + e); - } - - try - { - System.out.println("Test 2: DataInputStream read test"); - - FileInputStream fis = new FileInputStream("dataoutput-jdk.out"); + FileInputStream fis = new FileInputStream(filename); DataInputStream dis = new DataInputStream(fis); boolean passed = true; @@ -149,15 +118,56 @@ main(String[] argv) } if (passed) - System.out.println("PASSED: DataInputStream read test"); + System.out.println("PASSED: " + testname + " read test"); else - System.out.println("FAILED: DataInputStream read test"); + System.out.println("FAILED: " + testname + " read test"); } catch (IOException e) { - System.out.println("FAILED: DataInputStream read test: " + e); + System.out.println("FAILED: " + testname + " read test: " + e); } +} + +public static void +main(String[] argv) +{ + System.out.println("Started test of DataInputStream and DataOutputStream"); + + try + { + System.out.println("Test 1: DataOutputStream write test"); + + FileOutputStream fos = new FileOutputStream("dataoutput.out"); + DataOutputStream dos = new DataOutputStream(fos); + + dos.writeBoolean(true); + dos.writeBoolean(false); + dos.writeByte((byte)8); + dos.writeByte((byte)-122); + dos.writeChar((char)'a'); + dos.writeChar((char)'\uE2D2'); + dos.writeShort((short)32000); + dos.writeInt((int)8675309); + dos.writeLong((long)696969696969); + dos.writeFloat((float)3.1415); + dos.writeDouble((double)999999999.999); + dos.writeUTF("Testing code is such a boring activity but it must be done"); + dos.writeUTF("a-->\u01FF\uA000\u6666\u0200RRR"); + dos.close(); + + // We'll find out if this was really right later, but conditionally + // report success for now + System.out.println("PASSED: DataOutputStream write test"); + } + catch(IOException e) + { + System.out.println("FAILED: DataOutputStream write test: " + e); + } + + runReadTest("dataoutput.out", 2, "Read of JCL written data file"); + runReadTest("dataoutput-jdk.out", 3, "Read of JDK written data file"); + } // main } // class DataInputOutputTest diff --git a/test/java.io/LineNumberInputStreamTest.java b/test/java.io/LineNumberInputStreamTest.java index a85693679..26edebd41 100644 --- a/test/java.io/LineNumberInputStreamTest.java +++ b/test/java.io/LineNumberInputStreamTest.java @@ -1,11 +1,13 @@ /************************************************************************* /* LineNumberInputStreamTest.java -- Tests LineNumberInputStream's /* -/* Copyright (c) 1998 by Aaron M. Renn (arenn@urbanophile.com) +/* Copyright (c) 1998 Free Software Foundation, Inc. +/* Written by Aaron M. Renn (arenn@urbanophile.com) /* /* This program is free software; you can redistribute it and/or modify /* it under the terms of the GNU General Public License as published -/* by the Free Software Foundation, version 2. (see COPYING) +/* by the Free Software Foundation, either version 2 of the License, or +/* (at your option) any later version. /* /* This program is distributed in the hope that it will be useful, but /* WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/test/java.io/PushbackInputStreamTest.java b/test/java.io/PushbackInputStreamTest.java index ab9e98f09..ca2061453 100644 --- a/test/java.io/PushbackInputStreamTest.java +++ b/test/java.io/PushbackInputStreamTest.java @@ -1,11 +1,13 @@ /************************************************************************* /* PushbackInputStreamTest.java -- Tests PushbackInputStream's of course /* -/* Copyright (c) 1998 by Aaron M. Renn (arenn@urbanophile.com) +/* Copyright (c) 1998 Free Software Foundation, Inc. +/* Written by Aaron M. Renn (arenn@urbanophile.com) /* /* This program is free software; you can redistribute it and/or modify /* it under the terms of the GNU General Public License as published -/* by the Free Software Foundation, version 2. (see COPYING) +/* by the Free Software Foundation, either version 2 of the License, or +/* (at your option) any later version. /* /* This program is distributed in the hope that it will be useful, but /* WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/test/java.io/SequenceInputStreamTest.java b/test/java.io/SequenceInputStreamTest.java index fa4f263b3..0ca5fd988 100644 --- a/test/java.io/SequenceInputStreamTest.java +++ b/test/java.io/SequenceInputStreamTest.java @@ -1,11 +1,13 @@ /************************************************************************* /* SequenceInputStreamTest.java -- Tests SequenceInputStream's /* -/* Copyright (c) 1998 by Aaron M. Renn (arenn@urbanophile.com) +/* Copyright (c) 1998 Free Software Foundation, Inc. +/* Written by Aaron M. Renn (arenn@urbanophile.com) /* /* This program is free software; you can redistribute it and/or modify /* it under the terms of the GNU General Public License as published -/* by the Free Software Foundation, version 2. (see COPYING) +/* by the Free Software Foundation, either version 2 of the License, or +/* (at your option) any later version. /* /* This program is distributed in the hope that it will be useful, but /* WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/test/java.io/StringBufferInputStreamTest.java b/test/java.io/StringBufferInputStreamTest.java index 82d13af81..289f9d1b5 100644 --- a/test/java.io/StringBufferInputStreamTest.java +++ b/test/java.io/StringBufferInputStreamTest.java @@ -1,11 +1,13 @@ /************************************************************************* /* StringBufferInputStreamTest.java -- Test StringBufferInputStream's of course /* -/* Copyright (c) 1998 by Aaron M. Renn (arenn@urbanophile.com) +/* Copyright (c) 1998 Free Software Foundation, Inc. +/* Written by Aaron M. Renn (arenn@urbanophile.com) /* /* This program is free software; you can redistribute it and/or modify /* it under the terms of the GNU General Public License as published -/* by the Free Software Foundation, version 2. (see COPYING) +/* by the Free Software Foundation, either version 2 of the License, or +/* (at your option) any later version. /* /* This program is distributed in the hope that it will be useful, but /* WITHOUT ANY WARRANTY; without even the implied warranty of |