From: Nicholas Clark Date: Fri, 10 May 2013 07:25:13 +0000 (+0200) Subject: Stubbed subs no longer have CvOUTSIDE set. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=75510c888a93290158c2310b4e24495de6f5c692;p=p5sagit%2FDevel-Size.git Stubbed subs no longer have CvOUTSIDE set. t/code.t was testing whether Devel::Size was following CvOUTSIDE by relying on the implementation detail that CvOUTSIDE is set for a subroutine that is explicitly stubbed, and not set for one that is implicitly stubbed at runtime. v5.17.0 changed the compile-time behaviour so that no stubbed subroutine has CvOUTSIDE set, which breaks the assumption of this test. Hence change the test to verify the new behaviour. However, this leaves us currently with no test for CvOUTSIDE. (Based on a patch by Zefram. see RT #83903 and perl's commit 8be227ab5eaa23f2) --- diff --git a/CHANGES b/CHANGES index 8c6c799..1f7cd06 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ Revision history for Perl extension Devel::Size. + * stubbed subs no longer have CvOUTSIDE set [CPAN #77913] * Fix for v5.17.2's OP slab allocator [CPAN #83903] * Spelling fix to docs from gregor herrmann [CPAN #78766] diff --git a/t/code.t b/t/code.t index f2e1e26..eed0779 100644 --- a/t/code.t +++ b/t/code.t @@ -15,8 +15,13 @@ my $swoosh_size = total_size(\&swoosh); my $crunch_size = total_size(\&crunch); cmp_ok($whack_size, '>', 0, 'CV generated at runtime has a size'); -cmp_ok($zwapp_size, '>', $whack_size, - 'CV stubbed at compiletime is larger (CvOUTSIDE is set and followed)'); +if("$]" >= 5.017) { + cmp_ok($zwapp_size, '==', $whack_size, + 'CV stubbed at compiletime is the same size'); +} else { + cmp_ok($zwapp_size, '>', $whack_size, + 'CV stubbed at compiletime is larger (CvOUTSIDE is set and followed)'); +} cmp_ok(length prototype \&swoosh, '>', 0, 'prototype has a length'); cmp_ok($swoosh_size, '>', $zwapp_size + length prototype \&swoosh, 'prototypes add to the size');