[cairo-commit] cairo-perl/t CairoSurface.t,1.17.2.2,1.17.2.3

Torsten Schoenfeld commit at pdx.freedesktop.org
Fri Jan 5 13:02:53 PST 2007


Committed by: tsch

Update of /cvs/cairo/cairo-perl/t
In directory kemper:/tmp/cvs-serv5212/t

Modified Files:
      Tag: stable-1-0
	CairoSurface.t 
Log Message:
	* t/CairoSurface.t: Fix an endianness problem.


Index: CairoSurface.t
===================================================================
RCS file: /cvs/cairo/cairo-perl/t/CairoSurface.t,v
retrieving revision 1.17.2.2
retrieving revision 1.17.2.3
diff -u -d -r1.17.2.2 -r1.17.2.3
--- CairoSurface.t	23 Nov 2006 19:13:01 -0000	1.17.2.2
+++ CairoSurface.t	5 Jan 2007 21:02:49 -0000	1.17.2.3
@@ -9,6 +9,8 @@
 use strict;
 use warnings;
 
+use Config; # for byteorder
+
 use Test::More tests => 64;
 
 use constant {
@@ -54,7 +56,15 @@
 		$cr->fill;
 
 		is ($surf->get_data, $data);
-		is ($surf->get_data, pack ('CCCC', 0, 0, 255, 255));
+
+		my $bo = $Config{byteorder}+1;
+		if ($bo == 1234) {
+			is ($surf->get_data, pack ('CCCC', 0, 0, 255, 255));
+		} elsif ($bo == 4321) {
+			is ($surf->get_data, pack ('CCCC', 255, 255, 0, 0));
+		} else {
+			ok (1, 'Skipping get_data test; unknown endianness');
+		}
 	}
 }
 



More information about the cairo-commit mailing list