diff options
Diffstat (limited to 'tests')
9 files changed, 39 insertions, 98 deletions
diff --git a/tests/Camera2Tests/SmartCamera/SimpleCamera/jni/Android.mk b/tests/Camera2Tests/SmartCamera/SimpleCamera/jni/Android.mk index 616a11b36616..39ad0ac4bcdb 100644 --- a/tests/Camera2Tests/SmartCamera/SimpleCamera/jni/Android.mk +++ b/tests/Camera2Tests/SmartCamera/SimpleCamera/jni/Android.mk @@ -38,6 +38,8 @@ LOCAL_SRC_FILES := contrast.cpp \ sobeloperator.cpp \ stats_scorer.cpp +LOCAL_CFLAGS += -Wall -Wextra -Werror -Wno-unused-parameter + LOCAL_STATIC_LIBRARIES += \ libcutils diff --git a/tests/Camera2Tests/SmartCamera/SimpleCamera/jni/colorspace.cpp b/tests/Camera2Tests/SmartCamera/SimpleCamera/jni/colorspace.cpp index 63e2ebf2f3e7..ffb8003d4c50 100644 --- a/tests/Camera2Tests/SmartCamera/SimpleCamera/jni/colorspace.cpp +++ b/tests/Camera2Tests/SmartCamera/SimpleCamera/jni/colorspace.cpp @@ -65,9 +65,6 @@ void JNI_COLORSPACE_METHOD(nativeYuv420pToRgba8888)( uint8* pInV = pInput + size + size / 4; Rgba* pOutColor = pOutput; - const int u_offset = size; - const int v_offset = u_offset + size / 4; - for (int y = 0; y < height; y += 2) { for (int x = 0; x < width; x += 2) { int u, v, y1, y2, y3, y4; diff --git a/tests/Camera2Tests/SmartCamera/SimpleCamera/jni/sobeloperator.cpp b/tests/Camera2Tests/SmartCamera/SimpleCamera/jni/sobeloperator.cpp index dc5c305ea23f..808b90da372b 100644 --- a/tests/Camera2Tests/SmartCamera/SimpleCamera/jni/sobeloperator.cpp +++ b/tests/Camera2Tests/SmartCamera/SimpleCamera/jni/sobeloperator.cpp @@ -81,8 +81,6 @@ jboolean Java_androidx_media_filterpacks_image_SobelFilter_sobelOperator( short* gyPtr = new short[3 * numPixels]; computeGradient(srcPtr, width, height, gxPtr, gyPtr); - unsigned char* mag = magPtr; - unsigned char* dir = dirPtr; for (int i = 0; i < numPixels; ++i) { for (int c = 0; c < 3; c++) { int gx = static_cast<int>(*(gxPtr + 3 * i + c) / 8 + 127.5); diff --git a/tests/SoundTriggerTestApp/res/layout/main.xml b/tests/SoundTriggerTestApp/res/layout/main.xml index 5ecc7705cd75..702be49aac7b 100644 --- a/tests/SoundTriggerTestApp/res/layout/main.xml +++ b/tests/SoundTriggerTestApp/res/layout/main.xml @@ -66,6 +66,7 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="20dp" + android:checkedButton="@+id/model_one" android:orientation="vertical"> <RadioButton android:id="@+id/model_one" android:layout_width="wrap_content" @@ -84,15 +85,21 @@ android:onClick="onRadioButtonClicked"/> </RadioGroup> - <TextView - android:id="@+id/console" - android:gravity="left" +<ScrollView + android:id="@+id/scroller_id" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:scrollbars="vertical" + android:fillViewport="true"> + + <TextView + android:id="@+id/console" android:paddingTop="20pt" android:layout_height="fill_parent" - android:layout_width="match_parent" - android:maxLines="40" + android:layout_width="fill_parent" android:textSize="14dp" - android:scrollbars = "vertical" + android:layout_weight="1.0" android:text="@string/none"> </TextView> +</ScrollView> </LinearLayout> diff --git a/tests/SoundTriggerTestApp/res/values/strings.xml b/tests/SoundTriggerTestApp/res/values/strings.xml index 5f0fb1daf3e9..b4ca71b8286e 100644 --- a/tests/SoundTriggerTestApp/res/values/strings.xml +++ b/tests/SoundTriggerTestApp/res/values/strings.xml @@ -24,5 +24,5 @@ <string name="model_one">Model One</string> <string name="model_two">Model Two</string> <string name="model_three">Model Three</string> - <string name="none">Debug messages appear here:</string> + <string name="none">Debug messages appear here:\n</string> </resources> diff --git a/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/TestSoundTriggerActivity.java b/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/TestSoundTriggerActivity.java index 96a69661a7aa..3149783506de 100644 --- a/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/TestSoundTriggerActivity.java +++ b/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/TestSoundTriggerActivity.java @@ -32,6 +32,7 @@ import android.os.UserManager; import android.util.Log; import android.view.View; import android.widget.RadioButton; +import android.widget.ScrollView; import android.widget.TextView; import android.widget.Toast; @@ -52,6 +53,7 @@ public class TestSoundTriggerActivity extends Activity { private TextView mDebugView = null; private int mSelectedModelId = 1; + private ScrollView mScrollView = null; @Override protected void onCreate(Bundle savedInstanceState) { @@ -59,6 +61,7 @@ public class TestSoundTriggerActivity extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.main); mDebugView = (TextView) findViewById(R.id.console); + mScrollView = (ScrollView) findViewById(R.id.scroller_id); mDebugView.setText(mDebugView.getText(), TextView.BufferType.EDITABLE); mDebugView.setMovementMethod(new ScrollingMovementMethod()); mSoundTriggerUtil = new SoundTriggerUtil(this); @@ -68,6 +71,18 @@ public class TestSoundTriggerActivity extends Activity { private void postMessage(String msg) { Log.i(TAG, "Posted: " + msg); ((Editable) mDebugView.getText()).append(msg + "\n"); + if ((mDebugView.getMeasuredHeight() - mScrollView.getScrollY()) <= + (mScrollView.getHeight() + mDebugView.getLineHeight())) { + scrollToBottom(); + } + } + + private void scrollToBottom() { + mScrollView.post(new Runnable() { + public void run() { + mScrollView.smoothScrollTo(0, mDebugView.getBottom()); + } + }); } private UUID getSelectedUuid() { diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java index 46de2016e4e4..9ac4dbfed65a 100644 --- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java +++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java @@ -162,78 +162,6 @@ public class NotificationTestList extends TestActivity } }, - new Test("with topic Hello") { - public void run() { - Notification.BigTextStyle bigText = new Notification.BigTextStyle(); - bigText.bigText("FgBHreherhethethethe\ntwetwrterter\netetweterteryetry"); - Notification n = new Notification.Builder(NotificationTestList.this) - .setSmallIcon(R.drawable.icon1) - .setStyle(bigText) - .setWhen(mActivityCreateTime) - .setContentTitle("hihi") - .setContentText("This is a notification!!!") - .setContentIntent(makeIntent2()) - .setTopic(new Notification.Topic("hello", "Hello")) - .build(); - - mNM.notify(70, n); - } - }, - - new Test("with topic GoodBye") { - public void run() { - Notification.BigPictureStyle picture = new Notification.BigPictureStyle(); - picture.bigPicture(BitmapFactory.decodeResource(getResources(), - R.id.large_icon_pineapple2)); - Notification n = new Notification.Builder(NotificationTestList.this) - .setSmallIcon(R.drawable.icon1) - .setWhen(mActivityCreateTime) - .setContentTitle("byebye") - .setContentText("This is a notification!!!") - .setContentIntent(makeIntent2()) - .setTopic(new Notification.Topic("bye", "Goodbye")) - .setStyle(picture) - .build(); - - mNM.notify(71, n); - } - }, - new Test("with topic Bananas") { - public void run() { - Notification.BigTextStyle bigText = new Notification.BigTextStyle(); - bigText.bigText("bananas are great\nso tasty\nyum\nyum\nyum\n"); - Notification n = new Notification.Builder(NotificationTestList.this) - .setSmallIcon(R.drawable.icon1) - .setStyle(bigText) - .setWhen(mActivityCreateTime) - .setContentTitle("bananananana") - .setContentText("This is a banana!!!") - .setContentIntent(makeIntent2()) - .setTopic(new Notification.Topic("bananas", "Bananas")) - .build(); - - mNM.notify(72, n); - } - }, - - new Test("with delete intent") { - public void run() { - Notification.BigTextStyle bigText = new Notification.BigTextStyle(); - bigText.bigText("bananas are great\nso tasty\nyum\nyum\nyum\n"); - Notification n = new Notification.Builder(NotificationTestList.this) - .setSmallIcon(R.drawable.icon1) - .setStyle(bigText) - .setWhen(mActivityCreateTime) - .setContentTitle("bananananana") - .setContentText("This is a banana!!!") - .setTopic(new Notification.Topic("bananas", "Bananas")) - .setDeleteIntent(makeIntent2()) - .build(); - - mNM.notify(73, n); - } - }, - new Test("Is blocked?") { public void run() { Toast.makeText(NotificationTestList.this, @@ -242,18 +170,10 @@ public class NotificationTestList extends TestActivity } }, - new Test("Topic banana importance?") { - public void run() { - Toast.makeText(NotificationTestList.this, - "bananas importance? " + mNM.getImportance("bananas"), - Toast.LENGTH_LONG).show(); - } - }, - - new Test("Topic garbage importance?") { + new Test("importance?") { public void run() { Toast.makeText(NotificationTestList.this, - "garbage importance? " + mNM.getImportance("garbage"), + "importance? " + mNM.getImportance(), Toast.LENGTH_LONG).show(); } }, diff --git a/tests/touchlag/Android.mk b/tests/touchlag/Android.mk index 4f8aa1e60ca8..70b198917547 100644 --- a/tests/touchlag/Android.mk +++ b/tests/touchlag/Android.mk @@ -9,6 +9,8 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_MODULE:= test-touchlag +LOCAL_CFLAGS += -Wall -Wextra -Werror + LOCAL_MODULE_TAGS := tests include $(BUILD_EXECUTABLE) diff --git a/tests/touchlag/touchlag.cpp b/tests/touchlag/touchlag.cpp index df4befb95fb9..9264a254ed24 100644 --- a/tests/touchlag/touchlag.cpp +++ b/tests/touchlag/touchlag.cpp @@ -54,11 +54,11 @@ void clearBuffer(Buffer* buf, uint32_t pixel) { void drawTwoPixels(Buffer* buf, uint32_t pixel, ssize_t x, ssize_t y, size_t w) { if (y>0 && y<ssize_t(buf->h)) { uint32_t* bits = buf->pixels + y * buf->s; - if (x>=0 && x<buf->w) { + if (x>=0 && x<ssize_t(buf->w)) { bits[x] = pixel; } ssize_t W(w); - if ((x+W)>=0 && (x+W)<buf->w) { + if ((x+W)>=0 && (x+W)<ssize_t(buf->w)) { bits[x+W] = pixel; } } @@ -251,13 +251,13 @@ int main(int argc, char** argv) { Queue queue; - int x=0, y=0, down=0; + int x=0, y=0; int lag_x=0, lag_y=0; clearBuffer(&framebuffer, 0); while (true) { uint32_t crt = 0; - int err = ioctl(fd, FBIO_WAITFORVSYNC, &crt); + ioctl(fd, FBIO_WAITFORVSYNC, &crt); // draw beam marker drawRect(&framebuffer, 0x400000, framebuffer.w-2, 0, 2, framebuffer.h); |