Re: Future blog

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2010-12-09 at 12:45 +0000, Dr Andrew John Hughes wrote:
> I disagree.  Just because the version in gcj is different doesn't mean
> it's correct.  As far as I'm aware, Pekka already has a testcase for
> this so it would be good to have it in Mauve.

Sorry for the delay, here's a test case for getSimpleName().

			Pekka

>From 3637ab8ec4f866da6fadc092eab1f99ce4adb417 Mon Sep 17 00:00:00 2001
From: Pekka Enberg <penberg@xxxxxxxxxx>
Date: Sun, 12 Dec 2010 10:52:27 +0200
Subject: [PATCH] mauve: Add test case for Class.getSimpleName()

Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 gnu/testlet/java/lang/Class/ClassTest.java |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/gnu/testlet/java/lang/Class/ClassTest.java b/gnu/testlet/java/lang/Class/ClassTest.java
index 71b144c..c5927e8 100644
--- a/gnu/testlet/java/lang/Class/ClassTest.java
+++ b/gnu/testlet/java/lang/Class/ClassTest.java
@@ -577,6 +577,18 @@ public class ClassTest implements Cloneable, java.io.Serializable, Testlet
     harness.check(in == null);
   }
 
+  public void test_getSimpleName()
+  {
+    harness.checkPoint("test_getSimpleName");
+    harness.check(int.class.getSimpleName().equals("int"));
+    harness.check(int[].class.getSimpleName().equals("int[]"));
+    harness.check(int[][].class.getSimpleName().equals("int[][]"));
+    harness.check(Object[].class.getSimpleName().equals("Object[]"));
+    harness.check(Object.class.getSimpleName().equals("Object"));
+    harness.check(InnerClass.class.getSimpleName().equals("InnerClass"));
+  }
+  public static class InnerClass { };
+
   public void testall()
   {
     test_toString();
@@ -594,6 +606,7 @@ public class ClassTest implements Cloneable, java.io.Serializable, Testlet
     // This one doesn't work so well in Mauve.
     // test_getResource();
     test_getResourceAsStream();
+    test_getSimpleName();
 
   }
 
-- 
1.7.0.4






[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux