29
29
30
30
package net .imagej .ops .image .ascii ;
31
31
32
- import static org .junit .Assert .assertTrue ;
32
+ import static org .junit .Assert .assertEquals ;
33
33
34
34
import net .imagej .ops .AbstractOpTest ;
35
35
import net .imglib2 .img .Img ;
@@ -64,9 +64,9 @@ public void testDefaultASCII() {
64
64
final String ascii = (String ) ops .run (DefaultASCII .class , img );
65
65
for (int i = 0 ; i < len ; i ++) {
66
66
for (int j = 0 ; j < width ; j ++) {
67
- assertTrue (ascii .charAt (i * (width + 1 ) + j ) == CHARS .charAt (i ));
67
+ assertEquals (ascii .charAt (i * (width + 1 ) + j ), CHARS .charAt (i ));
68
68
}
69
- assertTrue (ascii .charAt (i * (width + 1 ) + width ) == '\n' );
69
+ assertEquals (ascii .charAt (i * (width + 1 ) + width ), '\n' );
70
70
}
71
71
}
72
72
@@ -89,16 +89,16 @@ public void testASCIIMinMax() {
89
89
final String ascii = (String ) ops .run (DefaultASCII .class , img , min , max );
90
90
for (int i = 0 ; i < len ; i ++) {
91
91
for (int j = 0 ; j < width ; j ++) {
92
- assertTrue (ascii .charAt (i * (width + 1 ) + j ) == CHARS .charAt (i ));
92
+ assertEquals (ascii .charAt (i * (width + 1 ) + j ), CHARS .charAt (i ));
93
93
}
94
- assertTrue (ascii .charAt (i * (width + 1 ) + width ) == '\n' );
94
+ assertEquals (ascii .charAt (i * (width + 1 ) + width ), '\n' );
95
95
}
96
96
97
- // make sure that the clamped ASCII string is not equivalent to the
98
- // unclamped String
97
+ // make sure that the values of the min/max ascii are the same as the
98
+ // unclamped version (which will set the minimum and maximum to those of the
99
+ // data, which are the same as the ones that we set).
99
100
final String asciiUnclamped = (String ) ops .run (DefaultASCII .class , img );
100
-
101
- assertTrue (asciiUnclamped != ascii );
101
+ assertEquals (asciiUnclamped , ascii );
102
102
103
103
}
104
104
}
0 commit comments