develooper Front page | perl.perl5.porters | Postings from January 2005

tests for attributes

Thread Next
From:
Nicholas Clark
Date:
January 1, 2005 04:36
Subject:
tests for attributes
Message ID:
20050101123552.GT77507@plum.flirble.org
t/op/attrs.t exists, describing itself as

# Regression tests for attributes.pm and the C< : attrs> syntax.

However, it doesn't seem to a fantastic job of code coverage. For example,
if you look at modify_SV_attributes in
http://www.ccl4.org/~nick/P/23712-g-gcov/xsutils.c.gcov
it's called 78 times, but 0% of the case statements are triggered. This
doesn't seem good.

As far as I can tell, the route to modify_SV_attributes is from
XS_attributes__modify_attrs, exposed at perl level as
&attributes::_modify_attrs, called via attributes::import.

Does anyone understand this stuff? Or am I the only one who is perturbed
by all this?

Part of the reason I'm curious is because I've noticed this bug:

	case SVt_PVCV:
	    switch ((int)len) {
	    case 6:
		switch (*name) {
		case 'a':
		    if (strEQ(name, "assertion")) {


("assertion" clearly isn't length 6, so this will never be true)
and I'm wondering why no-one else has ever encountered it.

Nicholas Clark

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About