In sv_size(), refactor the PV-derivatives to share as much code as possible.
[p5sagit/Devel-Size.git] / t / pvbm.t
CommitLineData
4a3d023d 1#!/usr/bin/perl -w
2
3use strict;
4use Test::More tests => 2;
5use Devel::Size ':all';
6use Config;
7
8use constant PVBM => 'galumphing';
9my $dummy = index 'galumphing', PVBM;
10
11if($Config{useithreads}) {
12 cmp_ok(total_size(PVBM), '>', 0, "PVBMs don't cause SEGVs");
13 # Really a core bug:
14 local $TODO = 'Under ithreads, pad constants are no longer PVBMs';
15 cmp_ok(total_size(PVBM), '>', total_size(PVBM . '') + 256,
16 "PVBMs use 256 bytes for a lookup table");
17} else {
18 cmp_ok(total_size(PVBM), '>', total_size(PVBM . ''),
19 "PVBMs don't cause SEGVs");
4a3d023d 20 cmp_ok(total_size(PVBM), '>', total_size(PVBM . '') + 256,
21 "PVBMs use 256 bytes for a lookup table");
22}