From 9dbfdc9ae1d9e2db5159829c35808f826c84bed6 Mon Sep 17 00:00:00 2001 From: Philipp Haller Date: Fri, 1 Aug 2008 15:52:25 +0000 Subject: Moved tests from jvm to jvm5. --- test/files/jvm/t1116.check | 0 test/files/jvm/t1116.scala | 27 ------------------ test/files/jvm/t1143.check | 0 test/files/jvm/t1143.scala | 68 --------------------------------------------- test/files/jvm5/t1116.check | 0 test/files/jvm5/t1116.scala | 27 ++++++++++++++++++ test/files/jvm5/t1143.check | 0 test/files/jvm5/t1143.scala | 68 +++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 95 insertions(+), 95 deletions(-) delete mode 100644 test/files/jvm/t1116.check delete mode 100644 test/files/jvm/t1116.scala delete mode 100644 test/files/jvm/t1143.check delete mode 100644 test/files/jvm/t1143.scala create mode 100644 test/files/jvm5/t1116.check create mode 100644 test/files/jvm5/t1116.scala create mode 100644 test/files/jvm5/t1143.check create mode 100644 test/files/jvm5/t1143.scala (limited to 'test') diff --git a/test/files/jvm/t1116.check b/test/files/jvm/t1116.check deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/files/jvm/t1116.scala b/test/files/jvm/t1116.scala deleted file mode 100644 index 023e5b3a02..0000000000 --- a/test/files/jvm/t1116.scala +++ /dev/null @@ -1,27 +0,0 @@ -object Serialize { - @throws(classOf[java.io.IOException]) - def write[A](o: A): Array[Byte] = { - val ba = new java.io.ByteArrayOutputStream(512) - val out = new java.io.ObjectOutputStream(ba) - out.writeObject(o) - out.close() - ba.toByteArray() - } - @throws(classOf[java.io.IOException]) - @throws(classOf[ClassNotFoundException]) - def read[A](buffer: Array[Byte]): A = { - val in = - new java.io.ObjectInputStream(new java.io.ByteArrayInputStream(buffer)) - in.readObject().asInstanceOf[A] - } -} - -object Foo { - def obj_foo(x: Int) = { () => x } -} - -object Test { - def main(args: Array[String]) { - Serialize.write(Foo.obj_foo(3)) - } -} diff --git a/test/files/jvm/t1143.check b/test/files/jvm/t1143.check deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/files/jvm/t1143.scala b/test/files/jvm/t1143.scala deleted file mode 100644 index 4f4557a2d6..0000000000 --- a/test/files/jvm/t1143.scala +++ /dev/null @@ -1,68 +0,0 @@ -object Serialize { - @throws(classOf[java.io.IOException]) - def write[A](o: A): Array[Byte] = { - val ba = new java.io.ByteArrayOutputStream(512) - val out = new java.io.ObjectOutputStream(ba) - out.writeObject(o) - out.close() - ba.toByteArray() - } - @throws(classOf[java.io.IOException]) - @throws(classOf[ClassNotFoundException]) - def read[A](buffer: Array[Byte]): A = { - val in = - new java.io.ObjectInputStream(new java.io.ByteArrayInputStream(buffer)) - in.readObject().asInstanceOf[A] - } -} - -@serializable -@SerialVersionUID(1L) -class VarModel[T](getter: => T, setter: T => Unit) { - Serialize.write(getter) - Serialize.write(setter) - - def this(getter: => T) = this(getter, null) - - def getObject: AnyRef = getter.asInstanceOf[AnyRef] - - def setObject(v: AnyRef) = { - if (setter == null) - throw new RuntimeException("Tried to set readonly model!") - setter(v.asInstanceOf[T]) - } - - def detach = () -} - -@serializable -@SerialVersionUID(1L) -class Printer(p: VarModel[String]) { - def print = println(p.getObject) -} - -@serializable -@SerialVersionUID(1L) -class Component { -} - -class Form extends Component { -} - -@serializable -@SerialVersionUID(1L) -class Main { - var pass = "pass" - def main(args: Array[String]) { - val f = new Form { - val p = new Printer(new VarModel(pass, pass=_)) - } - () - } -} - -object Test { - def main(args: Array[String]) { - (new Main).main(Array[String]()) - } -} diff --git a/test/files/jvm5/t1116.check b/test/files/jvm5/t1116.check new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/files/jvm5/t1116.scala b/test/files/jvm5/t1116.scala new file mode 100644 index 0000000000..023e5b3a02 --- /dev/null +++ b/test/files/jvm5/t1116.scala @@ -0,0 +1,27 @@ +object Serialize { + @throws(classOf[java.io.IOException]) + def write[A](o: A): Array[Byte] = { + val ba = new java.io.ByteArrayOutputStream(512) + val out = new java.io.ObjectOutputStream(ba) + out.writeObject(o) + out.close() + ba.toByteArray() + } + @throws(classOf[java.io.IOException]) + @throws(classOf[ClassNotFoundException]) + def read[A](buffer: Array[Byte]): A = { + val in = + new java.io.ObjectInputStream(new java.io.ByteArrayInputStream(buffer)) + in.readObject().asInstanceOf[A] + } +} + +object Foo { + def obj_foo(x: Int) = { () => x } +} + +object Test { + def main(args: Array[String]) { + Serialize.write(Foo.obj_foo(3)) + } +} diff --git a/test/files/jvm5/t1143.check b/test/files/jvm5/t1143.check new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/files/jvm5/t1143.scala b/test/files/jvm5/t1143.scala new file mode 100644 index 0000000000..4f4557a2d6 --- /dev/null +++ b/test/files/jvm5/t1143.scala @@ -0,0 +1,68 @@ +object Serialize { + @throws(classOf[java.io.IOException]) + def write[A](o: A): Array[Byte] = { + val ba = new java.io.ByteArrayOutputStream(512) + val out = new java.io.ObjectOutputStream(ba) + out.writeObject(o) + out.close() + ba.toByteArray() + } + @throws(classOf[java.io.IOException]) + @throws(classOf[ClassNotFoundException]) + def read[A](buffer: Array[Byte]): A = { + val in = + new java.io.ObjectInputStream(new java.io.ByteArrayInputStream(buffer)) + in.readObject().asInstanceOf[A] + } +} + +@serializable +@SerialVersionUID(1L) +class VarModel[T](getter: => T, setter: T => Unit) { + Serialize.write(getter) + Serialize.write(setter) + + def this(getter: => T) = this(getter, null) + + def getObject: AnyRef = getter.asInstanceOf[AnyRef] + + def setObject(v: AnyRef) = { + if (setter == null) + throw new RuntimeException("Tried to set readonly model!") + setter(v.asInstanceOf[T]) + } + + def detach = () +} + +@serializable +@SerialVersionUID(1L) +class Printer(p: VarModel[String]) { + def print = println(p.getObject) +} + +@serializable +@SerialVersionUID(1L) +class Component { +} + +class Form extends Component { +} + +@serializable +@SerialVersionUID(1L) +class Main { + var pass = "pass" + def main(args: Array[String]) { + val f = new Form { + val p = new Printer(new VarModel(pass, pass=_)) + } + () + } +} + +object Test { + def main(args: Array[String]) { + (new Main).main(Array[String]()) + } +} -- cgit v1.2.3