标签: createbitmap

Bitmap.CreateBitmap 在 JUnit 测试 Android Studio 中返回 null

我需要创建一个假位图图像来测试(JUnit 测试)我的个人添加和获取自定义 LinkedList 的方法,但 Bitmap.createBitmap 返回错误:

java.lang.RuntimeException:未模拟 android.graphics.Bitmap 中的方法 createBitmap。

这是我的 JUnitTest 的代码:

public class TicketsIteratorTest {

    Bitmap img_Bmp;
    TicketsIterator<Bitmap> TicketsList = new TicketsIterator();

    /*
     * Test for the add e get methods, check if the element just insert it's the same of the one just extract.
     */
    @Test
    public void Add_n_Get() throws Exception {
        int i = 0, numIMG = 100;
        Bitmap[] IMG_Generated;
        IMG_Generated = new Bitmap[numIMG];

        // Generate numIMG of imagine to insert into the Iterator and it …
Run Code Online (Sandbox Code Playgroud)

java junit android bitmap createbitmap

3
推荐指数
2
解决办法
2536
查看次数

标签 统计

android ×1

bitmap ×1

createbitmap ×1

java ×1

junit ×1