Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 173aeb5a authored by Paul Duffin's avatar Paul Duffin Committed by Arne Coucheron
Browse files

Stop using junit classes in production

Bug: 35234437
Bug: 30188076
Test: make checkbuild
Change-Id: Ib24448a030f05bb43a62eecec91ba08249672426
parent 5ff83041
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ package com.android.gallery3d.glrenderer;

import android.graphics.Bitmap;

import junit.framework.Assert;
import com.android.gallery3d.common.Utils;

// BitmapTexture is a texture whose content is specified by a fixed Bitmap.
//
@@ -34,7 +34,7 @@ public class BitmapTexture extends UploadedTexture {

    public BitmapTexture(Bitmap bitmap, boolean hasBorder) {
        super(hasBorder);
        Assert.assertTrue(bitmap != null && !bitmap.isRecycled());
        Utils.assertTrue(bitmap != null && !bitmap.isRecycled());
        mContentBitmap = bitmap;
    }

+3 −5
Original line number Diff line number Diff line
@@ -28,8 +28,6 @@ import com.android.gallery3d.common.ApiHelper;
import com.android.gallery3d.common.Utils;
import com.android.gallery3d.util.IntArray;

import junit.framework.Assert;

import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
@@ -127,7 +125,7 @@ public class GLES11Canvas implements GLCanvas {

    @Override
    public void setSize(int width, int height) {
        Assert.assertTrue(width >= 0 && height >= 0);
        Utils.assertTrue(width >= 0 && height >= 0);

        if (mTargetTexture == null) {
            mScreenWidth = width;
@@ -155,7 +153,7 @@ public class GLES11Canvas implements GLCanvas {

    @Override
    public void setAlpha(float alpha) {
        Assert.assertTrue(alpha >= 0 && alpha <= 1);
        Utils.assertTrue(alpha >= 0 && alpha <= 1);
        mAlpha = alpha;
    }

@@ -166,7 +164,7 @@ public class GLES11Canvas implements GLCanvas {

    @Override
    public void multiplyAlpha(float alpha) {
        Assert.assertTrue(alpha >= 0 && alpha <= 1);
        Utils.assertTrue(alpha >= 0 && alpha <= 1);
        mAlpha *= alpha;
    }

+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.gallery3d.glrenderer;

import junit.framework.Assert;
import com.android.gallery3d.common.Utils;

public class GLPaint {
    private float mLineWidth = 1f;
@@ -31,7 +31,7 @@ public class GLPaint {
    }

    public void setLineWidth(float width) {
        Assert.assertTrue(width >= 0);
        Utils.assertTrue(width >= 0);
        mLineWidth = width;
    }

+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import junit.framework.Assert;
import com.android.gallery3d.common.Utils;

// ResourceTexture is a texture whose Bitmap is decoded from a resource.
// By default ResourceTexture is not opaque.
@@ -30,7 +30,7 @@ public class ResourceTexture extends UploadedTexture {
    protected final int mResId;

    public ResourceTexture(Context context, int resId) {
        Assert.assertNotNull(context);
        Utils.checkNotNull(context);
        mContext = context;
        mResId = resId;
        setOpaque(false);
+3 −3
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.opengl.GLUtils;

import junit.framework.Assert;
import com.android.gallery3d.common.Utils;

import java.util.HashMap;

@@ -145,7 +145,7 @@ public abstract class UploadedTexture extends BasicTexture {
    }

    private void freeBitmap() {
        Assert.assertTrue(mBitmap != null);
        Utils.assertTrue(mBitmap != null);
        onFreeBitmap(mBitmap);
        mBitmap = null;
    }
@@ -229,7 +229,7 @@ public abstract class UploadedTexture extends BasicTexture {
                int texWidth = getTextureWidth();
                int texHeight = getTextureHeight();

                Assert.assertTrue(bWidth <= texWidth && bHeight <= texHeight);
                Utils.assertTrue(bWidth <= texWidth && bHeight <= texHeight);

                // Null pointer check here is to avoid monkey test failure.
                if (canvas.getGLId() != null) {