Skip to content

Commit

Permalink
[t] Fix t/src/embed.t
Browse files Browse the repository at this point in the history
Make test 3 fail with optimized builds (TT #1937).
Hopefully with other failures (TT #1964).
  • Loading branch information
nwellnhof committed Jan 15, 2011
1 parent b76fe7f commit d808617
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
6 changes: 4 additions & 2 deletions src/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -1394,8 +1394,10 @@ pt_add_to_interpreters(PARROT_INTERP, ARGIN_NULLOK(Parrot_Interp new_interp))
* Create an entry for the very first interpreter, event
* handling needs it
*/
PARROT_ASSERT(!interpreter_array);
PARROT_ASSERT(n_interpreters == 0);

if (interpreter_array || n_interpreters != 0)
Parrot_ex_throw_from_c_args(interp, NULL, 1,
"pt_add_to_interpreters: must pass new_interp when creating additional interps");

interpreter_array = mem_internal_allocate_typed(Interp *);
interpreter_array[0] = interp;
Expand Down
26 changes: 12 additions & 14 deletions t/src/embed.t
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ int main(void)
Parrot_Interp interp;
Parrot_PMC pmc, pmc2, pmc3;
Parrot_Int type, value, integer;
Parrot_String string;
Parrot_Float number;
interp = new_interp();
Expand All @@ -88,7 +87,6 @@ int main(void)
pmc = Parrot_PMC_new(interp, type);
pmc2 = Parrot_PMC_new(interp, type);
pmc3 = Parrot_PMC_new(interp, type);
string = Parrot_PMC_new(interp, Parrot_PMC_typenum(interp,"String"));
$code
Expand Down Expand Up @@ -322,7 +320,7 @@ extend_vtable_output_is(<<'CODE', <<'OUTPUT', "Parrot_PMC_i_add_float" );
Parrot_PMC_i_add_float(interp, pmc, number);
number = Parrot_PMC_get_number(interp, pmc);
Parrot_io_printf(interp,"%.2f\n", number);
Parrot_printf(interp,"%.2f\n", number);
CODE
1.00
Done!
Expand All @@ -334,7 +332,7 @@ extend_vtable_output_is(<<'CODE', <<'OUTPUT', "Parrot_PMC_add_int" );
pmc3 = Parrot_PMC_add_int(interp, pmc, integer, pmc3);
integer = Parrot_PMC_get_integer(interp, pmc3);
Parrot_io_printf(interp,"%d\n", integer);
Parrot_printf(interp,"%d\n", integer);
CODE
1
Done!
Expand Down Expand Up @@ -704,9 +702,9 @@ extend_vtable_output_is(<<'CODE', <<'OUTPUT', "Parrot_PMC_subtract" );
Parrot_PMC_set_integer_native(interp, pmc2, 10);
pmc3 = Parrot_PMC_subtract(interp, pmc, pmc2, pmc3);
Parrot_io_printf(interp, "%P\n", pmc3);
Parrot_printf(interp, "%P\n", pmc3);
pmc3 = Parrot_PMC_subtract(interp, pmc2, pmc, pmc3);
Parrot_io_printf(interp, "%P\n", pmc3);
Parrot_printf(interp, "%P\n", pmc3);
CODE
42
Expand All @@ -720,7 +718,7 @@ extend_vtable_output_is(<<'CODE', <<'OUTPUT', "Parrot_PMC_i_subtract" );
Parrot_PMC_set_integer_native(interp, pmc2, 10);
Parrot_PMC_i_subtract(interp, pmc, pmc2);
Parrot_io_printf(interp, "%P\n", pmc);
Parrot_printf(interp, "%P\n", pmc);
CODE
42
Expand All @@ -733,7 +731,7 @@ extend_vtable_output_is(<<'CODE', <<'OUTPUT', "Parrot_PMC_subtract_int" );
integer = 10;
pmc3 = Parrot_PMC_subtract_int(interp, pmc, integer, pmc3);
Parrot_io_printf(interp, "%P\n", pmc3);
Parrot_printf(interp, "%P\n", pmc3);
CODE
42
Expand All @@ -746,7 +744,7 @@ extend_vtable_output_is(<<'CODE', <<'OUTPUT', "Parrot_PMC_subtract_float" );
number = 10.0;
pmc3 = Parrot_PMC_subtract_float(interp, pmc, number, pmc3);
Parrot_io_printf(interp, "%P\n", pmc3);
Parrot_printf(interp, "%P\n", pmc3);
CODE
42
Expand All @@ -759,7 +757,7 @@ extend_vtable_output_is(<<'CODE', <<'OUTPUT', "Parrot_PMC_i_subtract_int" );
integer = 10;
Parrot_PMC_i_subtract_int(interp, pmc, integer);
Parrot_io_printf(interp, "%P\n", pmc);
Parrot_printf(interp, "%P\n", pmc);
CODE
42
Expand All @@ -772,7 +770,7 @@ extend_vtable_output_is(<<'CODE', <<'OUTPUT', "Parrot_PMC_i_subtract_float" );
number = 10.0;
Parrot_PMC_i_subtract_float(interp, pmc, number);
Parrot_io_printf(interp, "%P\n", pmc);
Parrot_printf(interp, "%P\n", pmc);
CODE
42
Expand All @@ -785,18 +783,18 @@ extend_vtable_output_is(<<'CODE', <<'OUTPUT', "Parrot_PMC_cmp" );
Parrot_PMC_set_integer_native(interp, pmc2, 17);
pmc3 = Parrot_PMC_cmp(interp, pmc, pmc2);
Parrot_io_printf(interp,"%d\n", pmc3 );
Parrot_printf(interp,"%d\n", pmc3 );
Parrot_PMC_set_integer_native(interp, pmc, 17);
Parrot_PMC_set_integer_native(interp, pmc2, 42);
pmc3 = Parrot_PMC_cmp(interp, pmc, pmc2);
Parrot_io_printf(interp,"%d\n", pmc3 );
Parrot_printf(interp,"%d\n", pmc3 );
Parrot_PMC_set_integer_native(interp, pmc, 42);
pmc3 = Parrot_PMC_cmp(interp, pmc, pmc2);
Parrot_io_printf(interp,"%d\n", pmc3 );
Parrot_printf(interp,"%d\n", pmc3 );
CODE
1
-1
Expand Down

0 comments on commit d808617

Please sign in to comment.