1 ################################################################################
3 # !!!!! Do NOT edit this file directly! !!!!!
5 # Edit mktests.PL and/or parts/inc/Sv_set instead.
7 # This file was automatically generated from the definition files in the
8 # parts/inc/ subdirectory by mktests.PL. To learn more about how all this
9 # works, please read the F<HACKERS> file that came with this distribution.
11 ################################################################################
14 if ($ENV{'PERL_CORE'}) {
16 @INC = ('../lib', '../ext/Devel-PPPort/t') if -d '../lib' && -d '../ext';
17 require Config; import Config;
19 if (" $Config{'extensions'} " !~ m[ Devel/PPPort ]) {
20 print "1..0 # Skip -- Perl configured without Devel::PPPort module\n";
30 require 'testutil.pl' if $@;
43 package Devel::PPPort;
46 @ISA = qw(DynaLoader);
47 bootstrap Devel::PPPort;
52 ok(&Devel::PPPort::TestSvUV_set($foo, 12345), 42);
53 ok(&Devel::PPPort::TestSvPVX_const("mhx"), 43);
54 ok(&Devel::PPPort::TestSvPVX_mutable("mhx"), 44);
59 ok($bar->x(), 'foobar');
61 Devel::PPPort::TestSvSTASH_set($bar, 'bar');
62 ok($bar->x(), 'hacker');
64 if ( "$]" lt '5.007003' ) {
65 skip 'skip: no SV_NOSTEAL support', 0 for 1..10;
67 ok(Devel::PPPort::Test_sv_setsv_SV_NOSTEAL());
69 tie my $scalar, 'TieScalarCounter', 'string';
71 ok tied($scalar)->{fetch}, 0;
72 ok tied($scalar)->{store}, 0;
73 my $copy = Devel::PPPort::newSVsv_nomg($scalar);
74 ok tied($scalar)->{fetch}, 0;
75 ok tied($scalar)->{store}, 0;
78 ok tied($scalar)->{fetch}, 1;
79 ok tied($scalar)->{store}, 0;
80 my $copy2 = Devel::PPPort::newSVsv_nomg($scalar);
81 ok tied($scalar)->{fetch}, 1;
82 ok tied($scalar)->{store}, 0;
86 package TieScalarCounter;
89 my ($class, $value) = @_;
90 return bless { fetch => 0, store => 0, value => $value }, $class;
96 return $self->{value};
100 my ($self, $value) = @_;
102 $self->{value} = $value;