2626import android .annotation .SuppressLint ;
2727import android .content .Context ;
2828import android .graphics .Canvas ;
29+ import android .os .Build .VERSION_CODES ;
2930import android .view .View .MeasureSpec ;
3031import android .view .ViewGroup .LayoutParams ;
3132import androidx .test .core .app .ApplicationProvider ;
4041
4142/** Tests for {@link MemoryView}. */
4243@ RunWith (RobolectricTestRunner .class )
43- @ Config (sdk = Config . OLDEST_SDK )
44+ @ Config (sdk = VERSION_CODES . M )
4445public class MemoryViewTest {
4546
4647 private static final int BYTES_IN_MB = 1024 * 1024 ;
@@ -70,7 +71,7 @@ public void setUpRuntime() {
7071 public void memoryView_correctText_withProvidedRuntime () {
7172 memoryView .refreshMemStats (runtime );
7273
73- assertThat (memoryView .getText ().toString ()).isEqualTo ("used: 25MB / 100MB (25%)" );
74+ assertThat (memoryView .getText ().toString ()).isEqualTo ("used: 25 MB / 100 MB (25%)" );
7475 }
7576
7677 @ Test
@@ -85,7 +86,7 @@ public void memoryView_pathNotEmpty_afterRefreshing() {
8586 assertThat (shadowCanvas .getPathPaintHistoryCount ()).isEqualTo (1 );
8687
8788 ShadowPath drawnPath = shadowOf (shadowCanvas .getDrawnPath (0 ));
88- assertThat (drawnPath .getPoints ().get (0 )).isEqualTo (new Point (34f , 250f , MOVE_TO ));
89+ assertThat (drawnPath .getPoints ().get (0 )).isEqualTo (new Point (36f , 250f , MOVE_TO ));
8990 }
9091
9192 @ SuppressLint ("WrongCall" ) // Testing onDraw
0 commit comments