summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/appwidgets/AppWidgetHostTest/Android.mk2
-rw-r--r--tests/appwidgets/AppWidgetProviderTest/Android.mk2
-rw-r--r--tests/framework-tests/src/android/util/EventLogFunctionalTest.java36
-rw-r--r--tests/framework-tests/src/android/util/EventLogTest.java4
4 files changed, 13 insertions, 31 deletions
diff --git a/tests/appwidgets/AppWidgetHostTest/Android.mk b/tests/appwidgets/AppWidgetHostTest/Android.mk
index 1bb1e54..4d0c704 100644
--- a/tests/appwidgets/AppWidgetHostTest/Android.mk
+++ b/tests/appwidgets/AppWidgetHostTest/Android.mk
@@ -1,7 +1,7 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_MODULE_TAGS := user
+LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-subdir-java-files)
diff --git a/tests/appwidgets/AppWidgetProviderTest/Android.mk b/tests/appwidgets/AppWidgetProviderTest/Android.mk
index c87a0f2..6084fb9 100644
--- a/tests/appwidgets/AppWidgetProviderTest/Android.mk
+++ b/tests/appwidgets/AppWidgetProviderTest/Android.mk
@@ -1,7 +1,7 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_MODULE_TAGS := user
+LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-subdir-java-files)
diff --git a/tests/framework-tests/src/android/util/EventLogFunctionalTest.java b/tests/framework-tests/src/android/util/EventLogFunctionalTest.java
index 8263083..8afe35f 100644
--- a/tests/framework-tests/src/android/util/EventLogFunctionalTest.java
+++ b/tests/framework-tests/src/android/util/EventLogFunctionalTest.java
@@ -59,31 +59,21 @@ public class EventLogFunctionalTest extends TestCase {
}
public void testLogOfListWithOneInt() throws Exception {
- final EventLog.List list = new EventLog.List(1234);
- final int numBytes = EventLog.writeEvent(TEST_TAG, list);
+ final int numBytes = EventLog.writeEvent(TEST_TAG, new Object[] {1234});
Assert.assertEquals(STARTING_POS_OF_PAYLOAD + 1 + 1 + 4 + 1, numBytes);
}
public void testLogOfListWithMultipleInts() throws Exception {
- final EventLog.List list = new EventLog.List(1234, 2345, 3456);
- final int numBytes = EventLog.writeEvent(TEST_TAG, list);
+ final int numBytes = EventLog.writeEvent(TEST_TAG, new Object[] {1234, 2345, 3456});
Assert.assertEquals(STARTING_POS_OF_PAYLOAD + 1 + 1 + 4 + 1 + 4 + 1 + 4 + 1, numBytes);
}
- public void testLogOfListWithEmbeddedList() throws Exception {
- final EventLog.List list = new EventLog.List(
- new EventLog.List(1234, 2345, 3456));
- final int numBytes = EventLog.writeEvent(TEST_TAG, list);
- Assert.assertEquals(STARTING_POS_OF_PAYLOAD + 2 + 1 + 1 + 4 + 1 + 4 + 1 + 4 + 1, numBytes);
- }
-
public void testEventLargerThanInitialBufferCapacity() throws Exception {
final Integer[] array = new Integer[127];
for (int i = 0; i < array.length; i++) {
array[i] = i;
}
- final EventLog.List list = new EventLog.List((Object[]) array);
- final int numBytes = EventLog.writeEvent(TEST_TAG, list);
+ final int numBytes = EventLog.writeEvent(TEST_TAG, (Object[]) array);
Assert.assertEquals(STARTING_POS_OF_PAYLOAD + 1 + (5 * array.length) + 1, numBytes);
}
@@ -117,8 +107,7 @@ public class EventLogFunctionalTest extends TestCase {
// This test is obsolete. See http://b/issue?id=1262082
public void disableTestReadCompoundEntry() throws Exception {
long when = System.currentTimeMillis();
- EventLog.writeEvent(2719,
- new EventLog.List(1l, new EventLog.List("2", "three", "4"), 5));
+ EventLog.writeEvent(2719, 1l, "2", 3);
Log.i(TAG, "Wrote compound event at T=" + when);
ArrayList<EventLog.Event> list = new ArrayList<EventLog.Event>();
@@ -129,18 +118,11 @@ public class EventLogFunctionalTest extends TestCase {
long eventTime = event.getTimeNanos() / 1000000;
Log.i(TAG, " Found event T=" + eventTime);
if (eventTime > when - 100 && eventTime < when + 1000) {
- EventLog.List data = (EventLog.List) event.getData();
- assertEquals(data.getNumItems(), 3);
-
- EventLog.List nested = (EventLog.List) data.getItem(1);
- assertEquals(nested.getNumItems(), 3);
-
- assertEquals(data.getItem(0), 1l);
- assertEquals(nested.getItem(0), "2");
- assertEquals(nested.getItem(1), "three");
- assertEquals(nested.getItem(2), "4");
- assertEquals(data.getItem(2), 5);
-
+ Object[] data = (Object[]) event.getData();
+ assertEquals(data.length, 3);
+ assertEquals(data[0], 1l);
+ assertEquals(data[1], "2");
+ assertEquals(data[2], 3);
assertFalse(found);
found = true;
}
diff --git a/tests/framework-tests/src/android/util/EventLogTest.java b/tests/framework-tests/src/android/util/EventLogTest.java
index 4a5d888..2a9e9cd 100644
--- a/tests/framework-tests/src/android/util/EventLogTest.java
+++ b/tests/framework-tests/src/android/util/EventLogTest.java
@@ -33,13 +33,13 @@ public class EventLogTest extends TestCase {
public void testIllegalListTypesThrowException() throws Exception {
try {
- EventLog.writeEvent(TEST_TAG, new EventLog.List(new Object()));
+ EventLog.writeEvent(TEST_TAG, new Object[]{new Object()});
fail("Can't create List with any old Object");
} catch (IllegalArgumentException e) {
// expected
}
try {
- EventLog.writeEvent(TEST_TAG, new EventLog.List((byte) 1));
+ EventLog.writeEvent(TEST_TAG, new Object[]{(byte) 1});
fail("Can't create List with any old byte");
} catch (IllegalArgumentException e) {
// expected