[svn:parrot] r44282 - in trunk: src/pmc t/pmc
bacek at svn.parrot.org
bacek at svn.parrot.org
Sun Feb 21 21:20:04 UTC 2010
Author: bacek
Date: Sun Feb 21 21:20:03 2010
New Revision: 44282
URL: https://trac.parrot.org/parrot/changeset/44282
Log:
Made OpLib singleton
Modified:
trunk/src/pmc/oplib.pmc
trunk/t/pmc/oplib.t
Modified: trunk/src/pmc/oplib.pmc
==============================================================================
--- trunk/src/pmc/oplib.pmc Sun Feb 21 20:24:02 2010 (r44281)
+++ trunk/src/pmc/oplib.pmc Sun Feb 21 21:20:03 2010 (r44282)
@@ -22,7 +22,7 @@
need to cache even a majority of the ~1300 ops. */
static PMC *OPLIB_PMC_INSTANCE;
static PMC *OPLIB_OPCODE_CACHE;
-pmclass OpLib {
+pmclass OpLib singleton {
void class_init() {
OPLIB_PMC_INSTANCE = NULL;
OPLIB_OPCODE_CACHE = NULL;
Modified: trunk/t/pmc/oplib.t
==============================================================================
--- trunk/t/pmc/oplib.t Sun Feb 21 20:24:02 2010 (r44281)
+++ trunk/t/pmc/oplib.t Sun Feb 21 21:20:03 2010 (r44282)
@@ -14,7 +14,7 @@
.sub main :main
.include 'test_more.pir'
- plan(1)
+ plan(2)
get_singleton()
.end
@@ -23,8 +23,12 @@
$I0 = isnull $P0
is($I0, 0)
- # TODO: How to test that this is actually a singleton?
- #$P1 = new ['OpLib']
- #is($P0, $P1)
+ $P1 = new ['OpLib']
+ eq_addr $P0, $P1, ok
+ ok(0, "all OpLibs aren't identical")
+ goto end
+ok:
+ ok(1, "all OpLibs are identical")
+end:
.end
More information about the parrot-commits
mailing list