2929
3030package net .imagej .ops .image .ascii ;
3131
32- import static org .junit .Assert .assertTrue ;
32+ import static org .junit .Assert .assertEquals ;
3333
3434import net .imagej .ops .AbstractOpTest ;
3535import net .imglib2 .img .Img ;
@@ -64,9 +64,9 @@ public void testDefaultASCII() {
6464 final String ascii = (String ) ops .run (DefaultASCII .class , img );
6565 for (int i = 0 ; i < len ; i ++) {
6666 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 ));
6868 }
69- assertTrue (ascii .charAt (i * (width + 1 ) + width ) == '\n' );
69+ assertEquals (ascii .charAt (i * (width + 1 ) + width ), '\n' );
7070 }
7171 }
7272
@@ -89,16 +89,16 @@ public void testASCIIMinMax() {
8989 final String ascii = (String ) ops .run (DefaultASCII .class , img , min , max );
9090 for (int i = 0 ; i < len ; i ++) {
9191 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 ));
9393 }
94- assertTrue (ascii .charAt (i * (width + 1 ) + width ) == '\n' );
94+ assertEquals (ascii .charAt (i * (width + 1 ) + width ), '\n' );
9595 }
9696
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).
99100 final String asciiUnclamped = (String ) ops .run (DefaultASCII .class , img );
100-
101- assertTrue (asciiUnclamped != ascii );
101+ assertEquals (asciiUnclamped , ascii );
102102
103103 }
104104}
0 commit comments