################################################################################
#
#            !!!!!   Do NOT edit this file directly!   !!!!!
#
#            Edit mktests.PL and/or parts/inc/SvPV instead.
#
#  This file was automatically generated from the definition files in the
#  parts/inc/ subdirectory by mktests.PL. To learn more about how all this
#  works, please read the F<HACKERS> file that came with this distribution.
#
################################################################################

use FindBin ();

BEGIN {
  if ($ENV{'PERL_CORE'}) {
    chdir 't' if -d 't';
    unshift @INC, '../lib' if -d '../lib' && -d '../ext';
    require Config; Config->import;
    use vars '%Config';
    if (" $Config{'extensions'} " !~ m[ Devel/PPPort ]) {
      print "1..0 # Skip -- Perl configured without Devel::PPPort module\n";
      exit 0;
    }
  }

  use lib "$FindBin::Bin";
  use lib "$FindBin::Bin/../parts/inc";

  die qq[Cannot find "$FindBin::Bin/../parts/inc"] unless -d "$FindBin::Bin/../parts/inc";

  sub load {
    require 'testutil.pl';
    require 'inctools';
  }

  if (50) {
    load();
    plan(tests => 50);
  }
}

use Devel::PPPort;
use strict;
BEGIN { $^W = 1; }

package Devel::PPPort;
use vars '@ISA';
require DynaLoader;
@ISA = qw(DynaLoader);
Devel::PPPort->bootstrap;

package main;

my $mhx = "mhx";

is(&Devel::PPPort::SvPVbyte($mhx), 3);

my $i = 42;

is(&Devel::PPPort::SvPV_nolen($mhx), $i++);
is(&Devel::PPPort::SvPV_const($mhx), $i++);
is(&Devel::PPPort::SvPV_mutable($mhx), $i++);
is(&Devel::PPPort::SvPV_flags($mhx), $i++);
is(&Devel::PPPort::SvPV_flags_const($mhx), $i++);

is(&Devel::PPPort::SvPV_flags_const_nolen($mhx), $i++);
is(&Devel::PPPort::SvPV_flags_mutable($mhx), $i++);
is(&Devel::PPPort::SvPV_force($mhx), $i++);
is(&Devel::PPPort::SvPV_force_nolen($mhx), $i++);
is(&Devel::PPPort::SvPV_force_mutable($mhx), $i++);

is(&Devel::PPPort::SvPV_force_nomg($mhx), $i++);
is(&Devel::PPPort::SvPV_force_nomg_nolen($mhx), $i++);
is(&Devel::PPPort::SvPV_force_flags($mhx), $i++);
is(&Devel::PPPort::SvPV_force_flags_nolen($mhx), $i++);
is(&Devel::PPPort::SvPV_force_flags_mutable($mhx), $i++);

is(&Devel::PPPort::SvPV_nolen_const($mhx), $i++);
is(&Devel::PPPort::SvPV_nomg($mhx), $i++);
is(&Devel::PPPort::SvPV_nomg_const($mhx), $i++);
is(&Devel::PPPort::SvPV_nomg_const_nolen($mhx), $i++);
is(&Devel::PPPort::SvPV_nomg_nolen($mhx), $i++);

$mhx = 42; is(&Devel::PPPort::SvPV_nolen($mhx), 0);
$mhx = 42; is(&Devel::PPPort::SvPV_const($mhx), 2);
$mhx = 42; is(&Devel::PPPort::SvPV_mutable($mhx), 2);
$mhx = 42; is(&Devel::PPPort::SvPV_flags($mhx), 2);
$mhx = 42; is(&Devel::PPPort::SvPV_flags_const($mhx), 2);

$mhx = 42; is(&Devel::PPPort::SvPV_flags_const_nolen($mhx), 0);
$mhx = 42; is(&Devel::PPPort::SvPV_flags_mutable($mhx), 2);
$mhx = 42; is(&Devel::PPPort::SvPV_force($mhx), 2);
$mhx = 42; is(&Devel::PPPort::SvPV_force_nolen($mhx), 0);
$mhx = 42; is(&Devel::PPPort::SvPV_force_mutable($mhx), 2);

$mhx = 42; is(&Devel::PPPort::SvPV_force_nomg($mhx), 2);
$mhx = 42; is(&Devel::PPPort::SvPV_force_nomg_nolen($mhx), 0);
$mhx = 42; is(&Devel::PPPort::SvPV_force_flags($mhx), 2);
$mhx = 42; is(&Devel::PPPort::SvPV_force_flags_nolen($mhx), 0);
$mhx = 42; is(&Devel::PPPort::SvPV_force_flags_mutable($mhx), 2);

$mhx = 42; is(&Devel::PPPort::SvPV_nolen_const($mhx), 0);
$mhx = 42; is(&Devel::PPPort::SvPV_nomg($mhx), 2);
$mhx = 42; is(&Devel::PPPort::SvPV_nomg_const($mhx), 2);
$mhx = 42; is(&Devel::PPPort::SvPV_nomg_const_nolen($mhx), 0);
$mhx = 42; is(&Devel::PPPort::SvPV_nomg_nolen($mhx), 0);

&Devel::PPPort::SvPVCLEAR($mhx);
is($mhx, "");

my $str = "";
&Devel::PPPort::SvPV_force($str);
my($s2, $before, $after) = &Devel::PPPort::SvPV_renew($str, 81, "x"x80);
is($str, "x"x80);
is($s2, "x"x80);
ok($before < 81);
is($after, 81);

$str = "x"x400;
&Devel::PPPort::SvPV_force($str);
($s2, $before, $after) = &Devel::PPPort::SvPV_renew($str, 41, "x"x40);
is($str, "x"x40);
is($s2, "x"x40);
ok($before > 41);
is($after, 41);

