[svn:parrot] r41503 - in branches/remove-next_for_GC: . config/gen/makefiles config/gen/platform/generic include/parrot src/interp src/runcore t/pir t/pmc t/src tools/dev
darbelo at svn.parrot.org
darbelo at svn.parrot.org
Sat Sep 26 22:30:42 UTC 2009
Author: darbelo
Date: Sat Sep 26 22:30:40 2009
New Revision: 41503
URL: https://trac.parrot.org/parrot/changeset/41503
Log:
Sync branch with trunk.
Added:
branches/remove-next_for_GC/t/pir/registernames.t
- copied unchanged from r41502, trunk/t/pir/registernames.t
Modified:
branches/remove-next_for_GC/ (props changed)
branches/remove-next_for_GC/CREDITS
branches/remove-next_for_GC/MANIFEST
branches/remove-next_for_GC/config/gen/makefiles/dynoplibs.in
branches/remove-next_for_GC/config/gen/makefiles/dynpmc.in
branches/remove-next_for_GC/config/gen/makefiles/pirc.in
branches/remove-next_for_GC/config/gen/platform/generic/hires_timer.c
branches/remove-next_for_GC/include/parrot/gc_api.h
branches/remove-next_for_GC/include/parrot/interpreter.h
branches/remove-next_for_GC/include/parrot/runcore_trace.h (props changed)
branches/remove-next_for_GC/src/interp/inter_cb.c
branches/remove-next_for_GC/src/interp/inter_create.c (props changed)
branches/remove-next_for_GC/src/runcore/cores.c (props changed)
branches/remove-next_for_GC/src/runcore/trace.c (props changed)
branches/remove-next_for_GC/t/pmc/fixedstringarray.t
branches/remove-next_for_GC/t/pmc/null.t
branches/remove-next_for_GC/t/src/embed.t (props changed)
branches/remove-next_for_GC/tools/dev/mk_gitignore.pl (props changed)
Modified: branches/remove-next_for_GC/CREDITS
==============================================================================
--- branches/remove-next_for_GC/CREDITS Sat Sep 26 21:55:09 2009 (r41502)
+++ branches/remove-next_for_GC/CREDITS Sat Sep 26 22:30:40 2009 (r41503)
@@ -192,6 +192,11 @@
N: Brian Wheeler
E: bdwheele at indiana.edu
+U: brianwisti
+N: Brian Wisti
+E: brian.wisti at gmail.com
+D: PIR Test demonstrating that $I1 and $I01 are different variables
+
N: Bruce Gray
U: util
E: bruce.gray at acm.org
Modified: branches/remove-next_for_GC/MANIFEST
==============================================================================
--- branches/remove-next_for_GC/MANIFEST Sat Sep 26 21:55:09 2009 (r41502)
+++ branches/remove-next_for_GC/MANIFEST Sat Sep 26 22:30:40 2009 (r41503)
@@ -1789,6 +1789,7 @@
t/pharness/03-handle_long_options.t [test]
t/pharness/04-Usage.t [test]
t/pir/macro.t [test]
+t/pir/registernames.t [test]
t/pmc/addrregistry.t [test]
t/pmc/array.t [test]
t/pmc/arrayiterator.t [test]
Modified: branches/remove-next_for_GC/config/gen/makefiles/dynoplibs.in
==============================================================================
--- branches/remove-next_for_GC/config/gen/makefiles/dynoplibs.in Sat Sep 26 21:55:09 2009 (r41502)
+++ branches/remove-next_for_GC/config/gen/makefiles/dynoplibs.in Sat Sep 26 22:30:40 2009 (r41503)
@@ -55,6 +55,7 @@
obscure_ops$(LOAD_EXT): obscure_ops$(O)
$(LD) @ld_out at obscure_ops$(LOAD_EXT) obscure_ops$(O) $(LINKARGS)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
obscure_ops$(O): obscure_ops.c
$(CC) -c @cc_o_out at obscure_ops$(O) $(INCLUDES) $(CFLAGS) obscure_ops.c
@@ -64,6 +65,7 @@
obscure_ops_switch$(LOAD_EXT): obscure_ops_switch$(O)
$(LD) @ld_out at obscure_ops_switch$(LOAD_EXT) obscure_ops_switch$(O) $(LINKARGS)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
obscure_ops_switch$(O): obscure_ops_switch.c
$(CC) -c @cc_o_out at obscure_ops_switch$(O) $(INCLUDES) $(CFLAGS) obscure_ops_switch.c
@@ -73,6 +75,7 @@
obscure_ops_cg$(LOAD_EXT): obscure_ops_cg$(O)
$(LD) @ld_out at obscure_ops_cg$(LOAD_EXT) obscure_ops_cg$(O) $(LINKARGS)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
obscure_ops_cg$(O): obscure_ops_cg.c
$(CC) -c @cc_o_out at obscure_ops_cg$(O) $(INCLUDES) $(CFLAGS) obscure_ops_cg.c
@@ -82,6 +85,7 @@
obscure_ops_cgp$(LOAD_EXT): obscure_ops_cgp$(O)
$(LD) @ld_out at obscure_ops_cgp$(LOAD_EXT) obscure_ops_cgp$(O) $(LINKARGS)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
obscure_ops_cgp$(O): obscure_ops_cgp.c
$(CC) -c @cc_o_out at obscure_ops_cgp$(O) $(INCLUDES) $(CFLAGS) obscure_ops_cgp.c
@@ -91,6 +95,7 @@
math_ops$(LOAD_EXT): math_ops$(O)
$(LD) @ld_out at math_ops$(LOAD_EXT) math_ops$(O) $(LINKARGS)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
math_ops$(O): math_ops.c
$(CC) -c @cc_o_out at math_ops$(O) $(INCLUDES) $(CFLAGS) math_ops.c
@@ -100,6 +105,7 @@
math_ops_switch$(LOAD_EXT): math_ops_switch$(O)
$(LD) @ld_out at math_ops_switch$(LOAD_EXT) math_ops_switch$(O) $(LINKARGS)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
math_ops_switch$(O): math_ops_switch.c
$(CC) -c @cc_o_out at math_ops_switch$(O) $(INCLUDES) $(CFLAGS) math_ops_switch.c
@@ -109,6 +115,7 @@
math_ops_cg$(LOAD_EXT): math_ops_cg$(O)
$(LD) @ld_out at math_ops_cg$(LOAD_EXT) math_ops_cg$(O) $(LINKARGS)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
math_ops_cg$(O): math_ops_cg.c
$(CC) -c @cc_o_out at math_ops_cg$(O) $(INCLUDES) $(CFLAGS) math_ops_cg.c
@@ -118,6 +125,7 @@
math_ops_cgp$(LOAD_EXT): math_ops_cgp$(O)
$(LD) @ld_out at math_ops_cgp$(LOAD_EXT) math_ops_cgp$(O) $(LINKARGS)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
math_ops_cgp$(O): math_ops_cgp.c
$(CC) -c @cc_o_out at math_ops_cgp$(O) $(INCLUDES) $(CFLAGS) math_ops_cgp.c
Modified: branches/remove-next_for_GC/config/gen/makefiles/dynpmc.in
==============================================================================
--- branches/remove-next_for_GC/config/gen/makefiles/dynpmc.in Sat Sep 26 21:55:09 2009 (r41502)
+++ branches/remove-next_for_GC/config/gen/makefiles/dynpmc.in Sat Sep 26 22:30:40 2009 (r41503)
@@ -99,6 +99,7 @@
dynlexpad$(LOAD_EXT): dynlexpad$(O)
$(LD) @ld_out at dynlexpad$(LOAD_EXT) dynlexpad$(O) $(LINKARGS)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
dynlexpad$(O): dynlexpad.c
$(CC) -c @cc_o_out at dynlexpad$(O) $(INCLUDES) $(CFLAGS) dynlexpad.c
@@ -111,6 +112,7 @@
foo_group$(LOAD_EXT): $(OBJS_FOO) lib-foo_group$(O)
$(LD) @ld_out at foo_group$(LOAD_EXT) lib-foo_group$(O) $(OBJS_FOO) $(LINKARGS)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
lib-foo_group$(O): foo_group.c
$(CC) -c @cc_o_out at lib-foo_group$(O) $(INCLUDES) $(CFLAGS) foo_group.c
@@ -138,6 +140,7 @@
rotest$(LOAD_EXT): rotest$(O)
$(LD) @ld_out at rotest$(LOAD_EXT) rotest$(O) $(LINKARGS)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
rotest$(O): rotest.c
$(CC) -c @cc_o_out at rotest$(O) $(INCLUDES) $(CFLAGS) rotest.c
@@ -150,6 +153,7 @@
gdbmhash$(LOAD_EXT): gdbmhash$(O)
$(LD) @ld_out at gdbmhash$(LOAD_EXT) gdbmhash$(O) $(LINKARGS) $(LIB_GDBM)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
gdbmhash$(O): gdbmhash.c
$(CC) -c @cc_o_out at gdbmhash$(O) $(INCLUDES) $(CFLAGS) gdbmhash.c
@@ -162,6 +166,7 @@
rational$(LOAD_EXT): rational$(O)
$(LD) @ld_out at rational$(LOAD_EXT) rational$(O) $(LINKARGS)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
rational$(O): rational.c
$(CC) -c @cc_o_out at rational$(O) $(INCLUDES) $(CFLAGS) rational.c
@@ -174,6 +179,7 @@
digest_group$(LOAD_EXT): $(OBJS_DIGEST) lib-digest_group$(O)
$(LD) @ld_out at digest_group$(LOAD_EXT) lib-digest_group$(O) $(OBJS_DIGEST) $(LINKARGS) $(LIB_CRYPTO)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
lib-digest_group$(O): digest_group.c
$(CC) -c @cc_o_out at lib-digest_group$(O) $(INCLUDES) $(CFLAGS) digest_group.c
@@ -255,6 +261,7 @@
subproxy$(LOAD_EXT): subproxy$(O)
$(LD) @ld_out at subproxy$(LOAD_EXT) subproxy$(O) $(LINKARGS)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
subproxy$(O): subproxy.c
$(CC) -c @cc_o_out at subproxy$(O) $(INCLUDES) $(CFLAGS) subproxy.c
Modified: branches/remove-next_for_GC/config/gen/makefiles/pirc.in
==============================================================================
--- branches/remove-next_for_GC/config/gen/makefiles/pirc.in Sat Sep 26 21:55:09 2009 (r41502)
+++ branches/remove-next_for_GC/config/gen/makefiles/pirc.in Sat Sep 26 22:30:40 2009 (r41503)
@@ -69,6 +69,7 @@
$(LINK) @ld_out@$@ \
$(OBJS) \
@rpath_blib@ @libparrot_linkflags@ $(C_LIBS) $(LINKFLAGS) $(LINK_DYNAMIC)
+#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
src/pirparser$(O): src/pirparser.c src/pirparser.h
src/pirlexer$(O): src/pirlexer.c src/pirlexer.h
Modified: branches/remove-next_for_GC/config/gen/platform/generic/hires_timer.c
==============================================================================
--- branches/remove-next_for_GC/config/gen/platform/generic/hires_timer.c Sat Sep 26 21:55:09 2009 (r41502)
+++ branches/remove-next_for_GC/config/gen/platform/generic/hires_timer.c Sat Sep 26 22:30:40 2009 (r41503)
@@ -21,6 +21,11 @@
*/
+#include "parrot/has_header.h"
+#ifdef PARROT_HAS_HEADER_UNISTD
+# include <unistd.h>
+#endif
+
#include <time.h>
#define TIME_IN_NS(n) ((n).tv_sec * 1000*1000*1000 + (n).tv_nsec)
@@ -38,7 +43,15 @@
UHUGEINTVAL Parrot_hires_get_time()
{
struct timespec ts;
+ #if _POSIX_TIMERS
clock_gettime(CLOCK_BEST, &ts);
+ #else
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+
+ ts.tv_sec = tv.tv_sec;
+ ts.tv_nsec = tv.tv_usec * 1000;
+ #endif
return TIME_IN_NS(ts);
}
Modified: branches/remove-next_for_GC/include/parrot/gc_api.h
==============================================================================
--- branches/remove-next_for_GC/include/parrot/gc_api.h Sat Sep 26 21:55:09 2009 (r41502)
+++ branches/remove-next_for_GC/include/parrot/gc_api.h Sat Sep 26 22:30:40 2009 (r41503)
@@ -459,23 +459,15 @@
void Parrot_gc_inf_init(PARROT_INTERP);
-#ifdef NDEBUG
-# define Parrot_gc_mark_PMC_alive(interp, obj) \
- do if (! PMC_IS_NULL(obj)) \
- Parrot_gc_mark_PMC_alive_fun((interp), (obj)); while (0)
-#ifdef PARROT_IN_CORE
+#if defined(NDEBUG) && defined(PARROT_IN_CORE)
# define Parrot_gc_mark_STRING_alive(interp, obj) \
do if (! STRING_IS_NULL(obj)) PObj_live_SET(obj); while (0)
#else
-# define Parrot_gc_mark_STRING_alive(interp, obj) \
- do if (! STRING_IS_NULL(obj) && !PObj_is_live_or_free_TESTALL(obj)) \
- Parrot_gc_mark_STRING_alive_fun((interp), (obj)); while (0)
-#endif
-#else
-# define Parrot_gc_mark_PMC_alive(interp, obj) Parrot_gc_mark_PMC_alive_fun((interp), (obj))
# define Parrot_gc_mark_STRING_alive(interp, obj) Parrot_gc_mark_STRING_alive_fun((interp), (obj))
#endif
+#define Parrot_gc_mark_PMC_alive(interp, obj) Parrot_gc_mark_PMC_alive_fun((interp), (obj))
+
#endif /* PARROT_GC_API_H_GUARD */
/*
Modified: branches/remove-next_for_GC/include/parrot/interpreter.h
==============================================================================
--- branches/remove-next_for_GC/include/parrot/interpreter.h Sat Sep 26 21:55:09 2009 (r41502)
+++ branches/remove-next_for_GC/include/parrot/interpreter.h Sat Sep 26 22:30:40 2009 (r41503)
@@ -416,16 +416,19 @@
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
PARROT_EXPORT
-void Parrot_callback_C(ARGIN(char *external_data), ARGMOD(PMC *user_data))
+void Parrot_callback_C(
+ ARGIN(char *external_data),
+ ARGMOD_NULLOK(PMC *user_data))
__attribute__nonnull__(1)
- __attribute__nonnull__(2)
FUNC_MODIFIES(*user_data);
PARROT_EXPORT
-void Parrot_callback_D(ARGMOD(PMC *user_data), ARGIN(char *external_data))
+void Parrot_callback_D(
+ ARGMOD(PMC *user_data),
+ ARGMOD_NULLOK(char *external_data))
__attribute__nonnull__(1)
- __attribute__nonnull__(2)
- FUNC_MODIFIES(*user_data);
+ FUNC_MODIFIES(*user_data)
+ FUNC_MODIFIES(*external_data);
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
@@ -450,11 +453,9 @@
FUNC_MODIFIES(* user_data);
#define ASSERT_ARGS_Parrot_callback_C __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(external_data) \
- && PARROT_ASSERT_ARG(user_data)
+ PARROT_ASSERT_ARG(external_data)
#define ASSERT_ARGS_Parrot_callback_D __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(user_data) \
- && PARROT_ASSERT_ARG(external_data)
+ PARROT_ASSERT_ARG(user_data)
#define ASSERT_ARGS_Parrot_make_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(sub) \
Modified: branches/remove-next_for_GC/src/interp/inter_cb.c
==============================================================================
--- branches/remove-next_for_GC/src/interp/inter_cb.c Sat Sep 26 21:55:09 2009 (r41502)
+++ branches/remove-next_for_GC/src/interp/inter_cb.c Sat Sep 26 22:30:40 2009 (r41503)
@@ -41,9 +41,10 @@
__attribute__nonnull__(3)
FUNC_MODIFIES(*user_data);
-static void verify_CD(ARGIN(char *external_data), ARGMOD(PMC *user_data))
+static void verify_CD(
+ ARGIN(char *external_data),
+ ARGMOD_NULLOK(PMC *user_data))
__attribute__nonnull__(1)
- __attribute__nonnull__(2)
FUNC_MODIFIES(*user_data);
#define ASSERT_ARGS_callback_CD __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -51,8 +52,7 @@
&& PARROT_ASSERT_ARG(external_data) \
&& PARROT_ASSERT_ARG(user_data)
#define ASSERT_ARGS_verify_CD __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(external_data) \
- && PARROT_ASSERT_ARG(user_data)
+ PARROT_ASSERT_ARG(external_data)
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
@@ -76,8 +76,7 @@
{
ASSERT_ARGS(Parrot_make_cb)
PMC *cb, *cb_sig;
- int type;
- char * sig_str;
+ int type = 0;
STRING *sc;
char * const signature = Parrot_str_to_cstring(interp, cb_signature);
/*
@@ -93,32 +92,23 @@
sc = CONST_STRING(interp, "_sub");
VTABLE_setprop(interp, user_data, sc, sub);
/* only ASCII signatures are supported */
- sig_str = signature;
+ if (strlen(signature) == 3) {
+ /* Callback return type ignored */
- if (strlen(sig_str) != 3) {
- mem_sys_free(signature);
- Parrot_ex_throw_from_c_args(interp, NULL, 1,
- "unhandled signature '%Ss' in make_cb", cb_signature);
- }
-
- ++sig_str; /* Skip callback return type */
-
- if (*sig_str == 'U') {
- type = 'D';
- }
- else {
- ++sig_str;
- if (*sig_str == 'U') {
- type = 'C';
+ if (signature[1] == 'U') {
+ type = 'D';
}
else {
- mem_sys_free(signature);
- Parrot_ex_throw_from_c_args(interp, NULL, 1,
- "unhandled signature '%Ss' in make_cb", cb_signature);
+ if (signature[2] == 'U') {
+ type = 'C';
+ }
}
}
+ Parrot_str_free_cstring(signature);
+ if (type != 'C' && type != 'D')
+ Parrot_ex_throw_from_c_args(interp, NULL, 1,
+ "unhandled signature '%Ss' in make_cb", cb_signature);
- mem_sys_free(signature);
cb_sig = pmc_new(interp, enum_class_String);
VTABLE_set_string_native(interp, cb_sig, cb_signature);
sc = CONST_STRING(interp, "_signature");
@@ -164,7 +154,7 @@
*/
static void
-verify_CD(ARGIN(char *external_data), ARGMOD(PMC *user_data))
+verify_CD(ARGIN(char *external_data), ARGMOD_NULLOK(PMC *user_data))
{
ASSERT_ARGS(verify_CD)
PARROT_INTERP = NULL;
@@ -177,7 +167,11 @@
*/
/* a NULL pointer or a pointer not aligned is very likely wrong */
- if (!user_data || ((UINTVAL)user_data & 3))
+ if (!user_data)
+ PANIC(interp, "user_data is NULL");
+ if (PMC_IS_NULL(user_data))
+ PANIC(interp, "user_data is PMCNULL");
+ if ((UINTVAL)user_data & 3)
PANIC(interp, "user_data doesn't look like a pointer");
/*
@@ -187,12 +181,11 @@
*/
LOCK(interpreter_array_mutex);
for (i = 0; i < n_interpreters; ++i) {
- if (interpreter_array[i] == NULL)
- continue;
- interp = interpreter_array[i];
- if (interp)
- if (Parrot_gc_ptr_is_pmc(interp, user_data))
- break;
+ Parrot_Interp checkinterp = interpreter_array [i];
+ if (checkinterp && Parrot_gc_ptr_is_pmc(checkinterp, user_data)) {
+ interp = checkinterp;
+ break;
+ }
}
UNLOCK(interpreter_array_mutex);
if (!interp)
@@ -394,7 +387,7 @@
PARROT_EXPORT
void
-Parrot_callback_C(ARGIN(char *external_data), ARGMOD(PMC *user_data))
+Parrot_callback_C(ARGIN(char *external_data), ARGMOD_NULLOK(PMC *user_data))
{
ASSERT_ARGS(Parrot_callback_C)
verify_CD(external_data, user_data);
@@ -402,7 +395,7 @@
PARROT_EXPORT
void
-Parrot_callback_D(ARGMOD(PMC *user_data), ARGIN(char *external_data))
+Parrot_callback_D(ARGMOD(PMC *user_data), ARGMOD_NULLOK(char *external_data))
{
ASSERT_ARGS(Parrot_callback_D)
verify_CD(external_data, user_data);
Copied: branches/remove-next_for_GC/t/pir/registernames.t (from r41502, trunk/t/pir/registernames.t)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/remove-next_for_GC/t/pir/registernames.t Sat Sep 26 22:30:40 2009 (r41503, copy of r41502, trunk/t/pir/registernames.t)
@@ -0,0 +1,36 @@
+#! parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/pir/registernames.t - Tests for PIR register variable names
+
+=head1 SYNOPSIS
+
+ % prove t/pir/registernames.t
+
+=head1 DESCRIPTION
+
+Tests for register variable names in PIR.
+
+=cut
+
+.sub 'main' :main
+ .include 'test_more.pir'
+ plan(1)
+ test_I01_is_not_I1()
+.end
+
+.sub test_I01_is_not_I1
+ $I1 = 1
+ $I01 = 2
+ isnt($I1,$I01, 'Register variables "$I1" and "$I01" are not the same variable')
+.end
+
+# Local Variables:
+# mode: pir
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+
Modified: branches/remove-next_for_GC/t/pmc/fixedstringarray.t
==============================================================================
--- branches/remove-next_for_GC/t/pmc/fixedstringarray.t Sat Sep 26 21:55:09 2009 (r41502)
+++ branches/remove-next_for_GC/t/pmc/fixedstringarray.t Sat Sep 26 22:30:40 2009 (r41503)
@@ -1,5 +1,5 @@
#! parrot
-# Copyright (C) 2001-2007, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
# $Id$
=head1 NAME
@@ -19,7 +19,7 @@
.sub 'main' :main
.include 'test_more.pir'
- plan(42)
+ plan(44)
'test_set_size'() # 2 tests
'test_reset_size'() # 1 test
@@ -28,14 +28,14 @@
'test_out_of_bounds'() # 4 tests
'test_set_via_pmc'() # 3 tests
'test_get_via_pmc'() # 4 tests
- 'test_interface_done'() # 4 tests
+ 'test_interface_done'() # 3 tests
'test_clone'() # 3 tests
'test_clone_unitialized'() # 2 tests
'test_truth'() # 2 tests
'test_get_iter'() # 1 test
'test_freez_thaw'() # 1 test
'test_get_string'() # 1 test
- 'test_equality'() # 3 tests
+ 'test_equality'() # 5 tests
'test_gc'() # 4 tests
.end
@@ -325,11 +325,17 @@
.end
.sub 'test_equality'
- .local pmc a1, a2
+ .local pmc a1, a2, other
+ .local int i
+ .local string s
a1 = new ['FixedStringArray']
a2 = new ['FixedStringArray']
+ other = new ['Integer']
is(a1, a2, "Empty arrays are equal")
+
+ i = iseq a1, other
+ is(i, 0, "Not equal to other type")
a1 = 3
isnt(a1, a2, "Different size arrays aren't equal")
@@ -346,6 +352,10 @@
a2[1] = "bar"
is(a1, a2, "Equal when second element same")
+
+ null s
+ a2[1] = s
+ isnt(a1, a2, "Not equal when second element is null")
.end
Modified: branches/remove-next_for_GC/t/pmc/null.t
==============================================================================
--- branches/remove-next_for_GC/t/pmc/null.t Sat Sep 26 21:55:09 2009 (r41502)
+++ branches/remove-next_for_GC/t/pmc/null.t Sat Sep 26 22:30:40 2009 (r41503)
@@ -17,12 +17,21 @@
=cut
.sub main :main
+ .local int i
.include 'test_more.pir'
- plan(1)
+ plan(3)
new $P0, ['Null']
ok(1, 'Instantiated a Null PMC')
+
+ new $P1, ['Null']
+ i = issame $P0, $P1
+ ok (i, 'Null is same as Null')
+
+ new $P2, ['Undef']
+ i = issame $P0, $P2
+ nok(i, 'Null is not same as not Null')
.end
# Local Variables:
More information about the parrot-commits
mailing list