[Bps-public-commit] r14483 - in Data-Plist: .

kyoki at bestpractical.com kyoki at bestpractical.com
Thu Jul 24 13:59:20 EDT 2008


Author: kyoki
Date: Thu Jul 24 13:59:19 2008
New Revision: 14483

Modified:
   Data-Plist/   (props changed)
   Data-Plist/t/binary-load.t

Log:
 r30004 at nyx:  kyoki | 2008-07-24 13:59:15 -0400
 more tests


Modified: Data-Plist/t/binary-load.t
==============================================================================
--- Data-Plist/t/binary-load.t	(original)
+++ Data-Plist/t/binary-load.t	Thu Jul 24 13:59:19 2008
@@ -1,4 +1,4 @@
-use Test::More tests => 64;
+use Test::More tests => 72;
 
 use strict;
 use warnings;
@@ -25,6 +25,10 @@
 ok( not($ret), "Not bplist doesn't load" );
 like( "$@", qr/not a binary plist/i, "Threw an error" );
 
+$ret = eval { $read->open_string("bpllst00") };
+ok( not($ret), "Not bplist doesn't load" );
+like( "$@", qr/not a binary plist/i, "Threw an error" );
+
 # No trailer
 $ret = eval { $read->open_string("bplist00") };
 ok( not($ret), "No trailer doesn't load" );
@@ -131,6 +135,13 @@
 ok( not($ret), "Invalid offset" );
 like( "$@", qr/invalid offset/i, "Threw an error" );
 
+$ret = eval {
+    $read->open_string(
+        "bplist00" . pack( "Cnx6CC(x4N)3", 0, 8, 0, 1, 1, 0, 9 ) );
+};
+ok( not($ret), "Invalid offset" );
+like( "$@", qr/invalid offset/i, "Threw an error" );
+
 # Invalid refsize
 $ret = eval {
     $read->open_string(
@@ -139,6 +150,13 @@
 ok( not($ret), "Invalid refsize" );
 like( "$@", qr/invalid reference/i, "Threw an error" );
 
+$ret = eval {
+    $read->open_string(
+        "bplist00" . pack( "Cnx6CC(x4N)3", 0, 8, 2, 0, 1, 0, 9 ) );
+};
+ok( not($ret), "Invalid refsize" );
+like( "$@", qr/invalid reference/i, "Threw an error" );
+
 # Invalid top object index
 $ret = eval {
     $read->open_string(
@@ -155,6 +173,13 @@
 ok( not($ret), "Invalid offset table address" );
 like( "$@", qr/invalid offset/i, "Threw an error" );
 
+$ret = eval {
+    $read->open_string(
+        "bplist00" . pack( "CCx6CC(x4N)3", 0, 8, 1, 1, 1, 0, 7 ) );
+};
+ok( not($ret), "Invalid offset table address" );
+like( "$@", qr/invalid offset table/i, "Threw an error" );
+
 # Refsize is too small for NumObjects
 my $string
     = do { local @ARGV = "t/data/longfile-03.binary.plist"; local $/; <> };



More information about the Bps-public-commit mailing list