Author: leo
Date: Wed Apr 13 06:07:34 2005
New Revision: 7825
Modified:
trunk/CREDITS
trunk/dynclasses/foo.pmc
trunk/runtime/parrot/library/SDL/Color.imc
trunk/t/dynclass/foo.t
trunk/t/pmc/mmd.t
Log:
MMD 22 - inheritance test
* update credits
* test overriden MMD in a dynamic class
---
[perl #34952] [PATCH] SDL unitialised variable
And... here's the patch!
Courtesy of Nick Glencross <[EMAIL PROTECTED]>
Modified: trunk/CREDITS
==============================================================================
--- trunk/CREDITS (original)
+++ trunk/CREDITS Wed Apr 13 06:07:34 2005
@@ -167,6 +167,9 @@
E: [EMAIL PROTECTED]
S: Lyon, France
+N: Jerry Gay
+D: remove Win32 compile warnings; pcre update
+
N: John Paul Wallington
D: pir-mode.el: fix for xemacs plus bugfixes and cleanups
Modified: trunk/dynclasses/foo.pmc
==============================================================================
--- trunk/dynclasses/foo.pmc (original)
+++ trunk/dynclasses/foo.pmc Wed Apr 13 06:07:34 2005
@@ -10,5 +10,14 @@
INTVAL get_integer() {
return 42;
}
+
+ void subtract (PMC* value, PMC* dest) {
+MMD_Integer: {
+ VTABLE_set_integer_native(INTERP, dest, 144);
+ }
+MMD_DEFAULT: {
+ VTABLE_set_integer_native(INTERP, dest, 244);
+ }
+ }
}
Modified: trunk/runtime/parrot/library/SDL/Color.imc
==============================================================================
--- trunk/runtime/parrot/library/SDL/Color.imc (original)
+++ trunk/runtime/parrot/library/SDL/Color.imc Wed Apr 13 06:07:34 2005
@@ -188,6 +188,8 @@
.local int offset
classoffset offset, self, 'SDL::Color'
+ color = 0
+
# red
inc offset
getattribute component, self, offset
Modified: trunk/t/dynclass/foo.t
==============================================================================
--- trunk/t/dynclass/foo.t (original)
+++ trunk/t/dynclass/foo.t Wed Apr 13 06:07:34 2005
@@ -16,7 +16,7 @@
=cut
-use Parrot::Test tests => 2;
+use Parrot::Test tests => 3;
use Parrot::Config;
pir_output_is(<< 'CODE', << 'OUTPUT', "get_integer");
@@ -60,3 +60,20 @@
OUTPUT
}
+
+pir_output_is(<<'CODE', <<'OUTPUT', "Foo subclass isa Integer");
+.sub main @MAIN
+ .local pmc F, f, d, r
+ loadlib F, "foo"
+ f = new "Foo"
+ f = 1
+ d = new Integer
+ r = new Integer
+ r = 2
+ d = f - r
+ print d
+ print "\n"
+.end
+CODE
+144
+OUTPUT
Modified: trunk/t/pmc/mmd.t
==============================================================================
--- trunk/t/pmc/mmd.t (original)
+++ trunk/t/pmc/mmd.t Wed Apr 13 06:07:34 2005
@@ -759,7 +759,7 @@
print "\n"
print r
print "\n"
- # this works only by calling the mmd_fallback
+ # dispatches to Parrot_Integer_add_Integer
add d, l, r
print d
print "\n"