RegressionTests__ImageReaderTest.st
branchjv
changeset 1500 d406a10b2965
parent 1499 26a16a04219b
parent 1447 2351db93aa5b
child 1567 e17701a073f9
--- a/RegressionTests__ImageReaderTest.st	Wed Jun 29 21:40:53 2016 +0100
+++ b/RegressionTests__ImageReaderTest.st	Thu Jun 30 09:02:08 2016 +0100
@@ -18,7 +18,7 @@
     documentation to be added.
 
     [author:]
-        cg (cg@AQUA-DUO)
+	cg (cg@AQUA-DUO)
 
     [instance variables:]
 
@@ -37,9 +37,9 @@
     img := Image fromFile:(self class packageDirectory construct:'testData/bmpImages/test1.bmp').
     self assert:(img notNil).
     self assert:(img depth == 1).
-    
+
     "/ img inspect.
-    
+
     self assert:((img colorAtX:0 y:0) rgbValue = 16r4040FF).
     self assert:((img colorAtX:0 y:63) rgbValue = 16r4040FF).
     self assert:((img colorAtX:0 y:18) rgbValue = 16r40FF40).
@@ -181,32 +181,32 @@
 
     img := Depth32Image width:16 height:16.
     alpha := #[
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
 
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
 
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
 
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
-                    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
-              ].
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+		    0 0 0 0 63 63 63 63 127 127 127 127 255 255 255 255
+	      ].
     s := WriteStream on:#[].
     alpha do:[:a |
-        s nextPut:127.    "/ r
-        s nextPut:127.    "/ g
-        s nextPut:127.    "/ b
-        s nextPut:a.    
+	s nextPut:127.    "/ r
+	s nextPut:127.    "/ g
+	s nextPut:127.    "/ b
+	s nextPut:a.
     ].
 
     bits := (s contents).
@@ -282,18 +282,18 @@
     failed := OrderedCollection new.
     allOK := true.
     (self class packageDirectory construct:'testData/bmpImages') directoryContentsAsFilenamesDo:[:f |
-        (f isRegularFile and:[f hasSuffix:'bmp']) ifTrue:[
-            Error handle:[:ex |
-                img := nil.
-            ] do:[
-                img := Image fromFile:f.
-            ].
-            img isNil ifTrue:[ 
-                Transcript printf:'failed: %s\n' with:f baseName.
-                allOK := false.
-                failed add:f baseName.
-            ].                
-        ].
+	(f isRegularFile and:[f hasSuffix:'bmp']) ifTrue:[
+	    Error handle:[:ex |
+		img := nil.
+	    ] do:[
+		img := Image fromFile:f.
+	    ].
+	    img isNil ifTrue:[
+		Transcript printf:'failed: %s\n' with:f baseName.
+		allOK := false.
+		failed add:f baseName.
+	    ].
+	].
     ].
     self assert:allOK description:('failed to read: %s' printfWith:(failed asStringWith:', ')).
 
@@ -309,18 +309,18 @@
     failed := OrderedCollection new.
     allOK := true.
     (self class packageDirectory construct:'testData/bmpImages/bmpsuite-2.4') directoryContentsAsFilenamesDo:[:f |
-        (f isRegularFile and:[f hasSuffix:'bmp']) ifTrue:[
-            Error handle:[:ex |
-                img := nil.
-            ] do:[
-                img := Image fromFile:f.
-            ].
-            img isNil ifTrue:[ 
-                Transcript printf:'failed: %s\n' with:f baseName.
-                allOK := false.
-                failed add:f baseName.
-            ].                
-        ].
+	(f isRegularFile and:[f hasSuffix:'bmp']) ifTrue:[
+	    Error handle:[:ex |
+		img := nil.
+	    ] do:[
+		img := Image fromFile:f.
+	    ].
+	    img isNil ifTrue:[
+		Transcript printf:'failed: %s\n' with:f baseName.
+		allOK := false.
+		failed add:f baseName.
+	    ].
+	].
     ].
     self assert:allOK description:('failed to read: %s' printfWith:(failed asStringWith:', ')).
 
@@ -339,29 +339,29 @@
     failed := OrderedCollection new.
     allOK := true.
     (self class packageDirectory construct:'testData/pngImages') directoryContentsAsFilenamesDo:[:f |
-        (f isRegularFile and:[f hasSuffix:'png']) ifTrue:[
-            img := nil.
-            (f baseName startsWith:'x') ifTrue:[
-                "/ should fail
-                self should:[ img := Image fromFile:f ] raise:(Image badImageFormatQuerySignal).
-                self assert:img == nil.
-            ] ifFalse:[    
-                Error handle:[:ex |
-                    img := nil.
-                ] do:[
+	(f isRegularFile and:[f hasSuffix:'png']) ifTrue:[
+	    img := nil.
+	    (f baseName startsWith:'x') ifTrue:[
+		"/ should fail
+		self should:[ img := Image fromFile:f ] raise:(Image badImageFormatQuerySignal).
+		self assert:img == nil.
+	    ] ifFalse:[
+		Error handle:[:ex |
+		    img := nil.
+		] do:[
                     img := Image fromFile:f.
-                ].    
-                img isNil ifTrue:[ 
-                    Transcript printf:'failed: %s\n' with:f baseName.
-                    allOK := false.
-                    failed add:f baseName.
-                ].
-            ].
-        ].
+		].
+		img isNil ifTrue:[
+		    Transcript printf:'failed: %s\n' with:f baseName.
+		    allOK := false.
+		    failed add:f baseName.
+		].
+	    ].
+	].
     ].
     "/ self assert:allOK description:('failed to read: %s' printfWith:(failed asStringWith:', ')).
     allOK ifFalse:[
-        self assert:(failed size == 4) description:('failed to read: %s' printfWith:(failed asStringWith:', ')).
+	self assert:(failed size == 4) description:('failed to read: %s' printfWith:(failed asStringWith:', ')).
     ].
 
     "
@@ -378,15 +378,15 @@
     img := Image fromFile:(self class packageDirectory construct:'testData/pngImages/basn0g01.png').
     self assert:(img notNil).
 
-    referenceImg := (Depth1Image new) width: 32; height: 32; 
-                            photometric:(#palette); 
-                            bitsPerSample:(#[1]); 
-                            samplesPerPixel:(1); 
-                            bits:(ByteArray fromPackedString:'
+    referenceImg := (Depth1Image new) width: 32; height: 32;
+			    photometric:(#palette);
+			    bitsPerSample:(#[1]);
+			    samplesPerPixel:(1);
+			    bits:(ByteArray fromPackedString:'
 ?????/????3????8????<OO3?>C3<??@<?O? OL3?0C3L?8@<3O<@O G>@C8A?@@?L? @O3O0@C??8@@??<@@O?>@@C??@@@?? O8O?0C>C?8@00?<@LLO>@
-C>C?@@? ? @LLO0@CCC8@@? <@@O8N@@@@C@@@@@ @@@@@@@@@@b') ; 
-                            colorMapFromArray:#[0 0 0 255 255 255]; 
-                            yourself.
+C>C?@@? ? @LLO0@CCC8@@? <@@O8N@@@@C@@@@@ @@@@@@@@@@b') ;
+			    colorMapFromArray:#[0 0 0 255 255 255];
+			    yourself.
 
     self assert:(img bits = referenceImg bits).
     self assert:(img width = referenceImg width).