/frameworks/base/test-base/src/junit/framework/ |
D | Assert.java | 62 static public void assertEquals(String message, Object expected, Object actual) { in assertEquals() argument 63 if (expected == null && actual == null) in assertEquals() 65 if (expected != null && expected.equals(actual)) in assertEquals() 67 failNotEquals(message, expected, actual); in assertEquals() 73 static public void assertEquals(Object expected, Object actual) { in assertEquals() argument 74 assertEquals(null, expected, actual); in assertEquals() 79 static public void assertEquals(String message, String expected, String actual) { in assertEquals() argument 80 if (expected == null && actual == null) in assertEquals() 82 if (expected != null && expected.equals(actual)) in assertEquals() 85 throw new ComparisonFailure(cleanMessage, expected, actual); in assertEquals() [all …]
|
/frameworks/base/core/tests/coretests/src/android/view/textclassifier/ |
D | TextClassifierEventTest.java | 49 final SelectionEvent expected = SelectionEvent.createSelectionStartedEvent( in toSelectionEvent_selectionStarted() local 51 expected.setTextClassificationSessionContext(TC_CONTEXT); in toSelectionEvent_selectionStarted() 52 expected.setSessionId(sessionId); in toSelectionEvent_selectionStarted() 60 assertEquals(expected, event.toSelectionEvent()); in toSelectionEvent_selectionStarted() 68 final SelectionEvent expected = SelectionEvent.createSelectionModifiedEvent( in toSelectionEvent_smartSelectionMulti() local 70 expected.setInvocationMethod(SelectionEvent.INVOCATION_MANUAL); in toSelectionEvent_smartSelectionMulti() 71 expected.setEventType(SelectionEvent.EVENT_SMART_SELECTION_MULTI); in toSelectionEvent_smartSelectionMulti() 72 expected.setStart(start); in toSelectionEvent_smartSelectionMulti() 73 expected.setEnd(end); in toSelectionEvent_smartSelectionMulti() 74 expected.setEventIndex(eventIndex); in toSelectionEvent_smartSelectionMulti() [all …]
|
/frameworks/native/libs/vr/libpdx/ |
D | serialization_tests.cpp | 117 Payload expected; in TEST() local 123 expected = {ENCODING_TYPE_TRUE}; in TEST() 124 EXPECT_EQ(expected, result); in TEST() 130 expected = {ENCODING_TYPE_FALSE}; in TEST() 131 EXPECT_EQ(expected, result); in TEST() 137 Payload expected; in TEST() local 143 expected = {ENCODING_TYPE_POSITIVE_FIXINT_MIN}; in TEST() 144 EXPECT_EQ(expected, result); in TEST() 150 expected = {ENCODING_TYPE_POSITIVE_FIXINT_MAX}; in TEST() 151 EXPECT_EQ(expected, result); in TEST() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/power/batterysaver/ |
D | CpuFrequenciesTest.java | 34 private void check(ArrayMap<String, String> expected, String config) { in check() argument 36 assertEquals(expected, actual.toSysFileMap()); in check() 43 final ArrayMap<String, String> expected = new ArrayMap<>(); in test() local 45 expected.clear(); in test() 46 expected.put("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", "0"); in test() 47 check(expected, "0:0"); in test() 49 expected.clear(); in test() 50 expected.put("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", "0"); in test() 51 expected.put("/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq", "1"); in test() 52 check(expected, "0:0/1:1"); in test() [all …]
|
/frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/ |
D | CameraErrorCollector.java | 147 public <T> boolean expectEquals(String msg, T expected, T actual) { in expectEquals() argument 148 if (expected == null) { in expectEquals() 152 if (!Objects.equals(expected, actual)) { in expectEquals() 153 addMessage(String.format("%s (expected = %s, actual = %s) ", msg, expected, in expectEquals() 169 public <T> boolean expectNotEquals(String msg, T expected, T actual) { in expectNotEquals() argument 170 if (Objects.equals(expected, actual)) { in expectNotEquals() 171 addMessage(String.format("%s (expected = %s, actual = %s) ", msg, expected, in expectNotEquals() 189 public <T> boolean expectEquals(String msg, T[] expected, T[] actual) { in expectEquals() argument 190 if (expected == null) { in expectEquals() 194 if (!Arrays.deepEquals(expected, actual)) { in expectEquals() [all …]
|
/frameworks/base/test-runner/src/android/test/ |
D | MoreAsserts.java | 46 public static void assertAssignableFrom(Class<?> expected, Object actual) { in assertAssignableFrom() argument 47 assertAssignableFrom(expected, actual.getClass()); in assertAssignableFrom() 55 public static void assertAssignableFrom(Class<?> expected, Class<?> actual) { in assertAssignableFrom() argument 57 "Expected " + expected.getCanonicalName() + in assertAssignableFrom() 59 expected.isAssignableFrom(actual)); in assertAssignableFrom() 87 String message, byte[] expected, byte[] actual) { in assertEquals() argument 88 if (expected.length != actual.length) { in assertEquals() 89 failWrongLength(message, expected.length, actual.length); in assertEquals() 91 for (int i = 0; i < expected.length; i++) { in assertEquals() 92 if (expected[i] != actual[i]) { in assertEquals() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/ |
D | PasswordSlotManagerTests.java | 59 Set<Integer> expected = new HashSet<Integer>(); in testBasicSlotUse() local 60 expected.add(0); in testBasicSlotUse() 61 expected.add(1); in testBasicSlotUse() 62 assertEquals(expected, mManager.getUsedSlots()); in testBasicSlotUse() 66 expected = new HashSet<Integer>(); in testBasicSlotUse() 67 expected.add(0); in testBasicSlotUse() 68 assertEquals(expected, mManager.getUsedSlots()); in testBasicSlotUse() 90 Set<Integer> expected = new HashSet<Integer>(); in testMergeSlots() local 91 expected.add(1); in testMergeSlots() 92 expected.add(3); in testMergeSlots() [all …]
|
D | RebootEscrowDataTest.java | 64 @Test(expected = NullPointerException.class) 69 @Test(expected = NullPointerException.class) 72 RebootEscrowData expected = RebootEscrowData.fromSyntheticPassword(mKey, (byte) 2, testSp, in fromEncryptedData_failsOnNullData() local 74 RebootEscrowKey key = RebootEscrowKey.fromKeyBytes(expected.getKey().getKeyBytes()); in fromEncryptedData_failsOnNullData() 78 @Test(expected = NullPointerException.class) 81 RebootEscrowData expected = RebootEscrowData.fromSyntheticPassword(mKey, (byte) 2, testSp, in fromEncryptedData_failsOnNullKey() local 83 RebootEscrowData.fromEncryptedData(null, expected.getBlob(), mKeyStoreEncryptionKey); in fromEncryptedData_failsOnNullKey() 89 RebootEscrowData expected = RebootEscrowData.fromSyntheticPassword(mKey, (byte) 2, testSp, in fromEntries_loopback_success() local 92 RebootEscrowKey key = RebootEscrowKey.fromKeyBytes(expected.getKey().getKeyBytes()); in fromEntries_loopback_success() 93 RebootEscrowData actual = RebootEscrowData.fromEncryptedData(key, expected.getBlob(), in fromEntries_loopback_success() [all …]
|
/frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/ |
D | ValidateNotificationPeopleTest.java | 63 String[] expected = { "foobar" }; in testSingleString() local 65 bundle.putString(Notification.EXTRA_PEOPLE_LIST, expected[0]); in testSingleString() 67 assertStringArrayEquals("string should be in result[0]", expected, result); in testSingleString() 72 String[] expected = { "foobar" }; in testSingleCharArray() local 74 bundle.putCharArray(Notification.EXTRA_PEOPLE_LIST, expected[0].toCharArray()); in testSingleCharArray() 76 assertStringArrayEquals("char[] should be in result[0]", expected, result); in testSingleCharArray() 81 String[] expected = { "foobar" }; in testSingleCharSequence() local 83 bundle.putCharSequence(Notification.EXTRA_PEOPLE_LIST, new SpannableString(expected[0])); in testSingleCharSequence() 85 assertStringArrayEquals("charSequence should be in result[0]", expected, result); in testSingleCharSequence() 91 String[] expected = { "foobar" }; in testStringArraySingle() local [all …]
|
D | ArchiveTest.java | 76 List<String> expected = new ArrayList<>(); in testRecordAndRead() local 80 expected.add(sbn.getKey()); in testRecordAndRead() 85 assertThat(actual).hasSize(expected.size()); in testRecordAndRead() 87 assertThat(expected).contains(sbn.getKey()); in testRecordAndRead() 93 List<String> expected = new ArrayList<>(); in testRecordAndRead_overLimit() local 98 expected.add(sbn.getKey()); in testRecordAndRead_overLimit() 103 assertThat(actual).hasSize(expected.size()); in testRecordAndRead_overLimit() 105 assertThat(expected).contains(sbn.getKey()); in testRecordAndRead_overLimit() 112 List<String> expected = new ArrayList<>(); in testDoesNotRecordIfHistoryDisabled() local 118 expected.add(sbn.getKey()); in testDoesNotRecordIfHistoryDisabled() [all …]
|
D | GlobalSortKeyComparatorTest.java | 71 final List<NotificationRecord> expected = new ArrayList<>(); in testComparator() local 72 expected.add(left); in testComparator() 73 expected.add(right); in testComparator() 74 expected.add(last); in testComparator() 77 actual.addAll(expected); in testComparator() 82 assertEquals(expected, actual); in testComparator() 102 final List<NotificationRecord> expected = new ArrayList<>(); in testNoCrash_leftNull() local 103 expected.add(right); in testNoCrash_leftNull() 104 expected.add(left); in testNoCrash_leftNull() 107 actual.addAll(expected); in testNoCrash_leftNull() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ |
D | PackageInstallerSessionTest.java | 260 private void assertSessionParamsEquivalent(PackageInstaller.SessionParams expected, in assertSessionParamsEquivalent() argument 262 assertEquals(expected.mode, actual.mode); in assertSessionParamsEquivalent() 263 assertEquals(expected.installFlags, actual.installFlags); in assertSessionParamsEquivalent() 264 assertEquals(expected.installLocation, actual.installLocation); in assertSessionParamsEquivalent() 265 assertEquals(expected.installReason, actual.installReason); in assertSessionParamsEquivalent() 266 assertEquals(expected.sizeBytes, actual.sizeBytes); in assertSessionParamsEquivalent() 267 assertEquals(expected.appPackageName, actual.appPackageName); in assertSessionParamsEquivalent() 268 assertEquals(expected.appIcon, actual.appIcon); in assertSessionParamsEquivalent() 269 assertEquals(expected.originatingUri, actual.originatingUri); in assertSessionParamsEquivalent() 270 assertEquals(expected.originatingUid, actual.originatingUid); in assertSessionParamsEquivalent() [all …]
|
/frameworks/native/libs/vr/libdvrcommon/include/private/dvr/test/ |
D | test_macros.h | 16 const A& expected, const B& actual, const T& tolerance) { in CmpArrayLikeFloatEq() argument 18 if (!IsEqual(expected[i], actual[i], tolerance)) { in CmpArrayLikeFloatEq() 23 << " Expected \"" << expected[i] << "\", was \"" << actual[i] in CmpArrayLikeFloatEq() 34 const A& expected, const B& actual, const T& tolerance) { in CmpMatrixLikeFloatEq() argument 37 if (!IsEqual(expected(r, c), actual(r, c), tolerance)) { in CmpMatrixLikeFloatEq() 42 << " Expected \"" << expected(r, c) << "\", was \"" in CmpMatrixLikeFloatEq() 54 const A& expected, const B& actual, const T& tolerance) { in CmpArrayLikeFloatNe() argument 56 if (!IsEqual(expected[i], actual[i], tolerance)) { in CmpArrayLikeFloatNe() 72 const A& expected, const B& actual, const T& tolerance) { in CmpMatrixLikeFloatNe() argument 75 if (!IsEqual(expected(r, c), actual(r, c), tolerance)) { in CmpMatrixLikeFloatNe() [all …]
|
/frameworks/base/cmds/incident_helper/tests/ |
D | ih_util_test.cpp | 29 header_t result, expected; in TEST() local 31 EXPECT_EQ(expected, result); in TEST() 34 expected = { "100", "00", "opq", "wqrw" }; in TEST() 35 EXPECT_EQ(expected, result); in TEST() 38 expected = { "100 00", "oooh", "wtf" }; in TEST() 39 EXPECT_EQ(expected, result); in TEST() 42 expected = { "123", "456", "78_9" }; in TEST() 43 EXPECT_EQ(expected, result); in TEST() 47 record_t result, expected; in TEST() local 49 EXPECT_EQ(expected, result); in TEST() [all …]
|
D | SystemPropertiesParser_test.cpp | 55 SystemPropertiesProto expected; in TEST_F() local 57 expected.mutable_aac_drc()->set_cut(123); in TEST_F() 58 expected.mutable_aaudio()->set_hw_burst_min_usec(2000); in TEST_F() 59 expected.mutable_aaudio()->set_mmap_exclusive_policy(2); in TEST_F() 60 expected.mutable_dalvik_vm()->set_appimageformat("lz4"); in TEST_F() 61 expected.set_drm_64bit_enabled(false); in TEST_F() 62 expected.mutable_init_svc()->set_adbd( in TEST_F() 64 expected.mutable_init_svc()->set_lmkd( in TEST_F() 66 expected.set_media_mediadrmservice_enable(true); in TEST_F() 68 SystemPropertiesProto::Ro* ro = expected.mutable_ro(); in TEST_F() [all …]
|
/frameworks/native/services/surfaceflinger/tests/ |
D | LayerCallback_test.cpp | 150 ExpectedResult expected; in TEST_F() local 151 expected.addSurface(ExpectedResult::Transaction::PRESENTED, layer); in TEST_F() 152 EXPECT_NO_FATAL_FAILURE(waitForCallback(callback, expected, true)); in TEST_F() 172 ExpectedResult expected; in TEST_F() local 173 expected.addSurface(ExpectedResult::Transaction::NOT_PRESENTED, layer, in TEST_F() 175 EXPECT_NO_FATAL_FAILURE(waitForCallback(callback, expected, true)); in TEST_F() 195 ExpectedResult expected; in TEST_F() local 196 expected.addSurface(ExpectedResult::Transaction::PRESENTED, layer); in TEST_F() 197 EXPECT_NO_FATAL_FAILURE(waitForCallback(callback, expected, true)); in TEST_F() 217 ExpectedResult expected; in TEST_F() local [all …]
|
D | ReleaseBufferCallback_test.cpp | 136 ExpectedResult expected; in TEST_F() local 137 expected.addSurface(ExpectedResult::Transaction::PRESENTED, layer, in TEST_F() 139 ASSERT_NO_FATAL_FAILURE(waitForCallback(transactionCallback, expected)); in TEST_F() 156 expected = ExpectedResult(); in TEST_F() 157 expected.addSurface(ExpectedResult::Transaction::PRESENTED, layer, in TEST_F() 160 ASSERT_NO_FATAL_FAILURE(waitForCallback(transactionCallback, expected)); in TEST_F() 175 ExpectedResult expected; in TEST_F() local 176 expected.addSurface(ExpectedResult::Transaction::PRESENTED, layer, in TEST_F() 178 ASSERT_NO_FATAL_FAILURE(waitForCallback(transactionCallback, expected)); in TEST_F() 188 expected = ExpectedResult(); in TEST_F() [all …]
|
/frameworks/libs/net/common/testutils/hostdevice/com/android/testutils/ |
D | MiscAsserts.kt | 39 fun <T> assertLength(expected: Int, got: Array<T>) = got.size.let { len -> in len() 40 assertEquals(expected, len, "Expected array of length $expected, but was $len for $got") in len() 43 fun <T> assertLength(expected: Int, got: List<T>) = got.size.let { len -> in len() 44 assertEquals(expected, len, "Expected list of length $expected, but was $len for $got") in len() 49 fun <T : Exception> assertThrows(expected: Class<T>, block: ThrowingRunnable): T { in assertThrows() 50 return assertFailsWith(expected.kotlin) { block.run() } in assertThrows() 53 fun <T : Exception> assertThrows(msg: String, expected: Class<T>, block: ThrowingRunnable): T { in assertThrows() 54 return assertFailsWith(expected.kotlin, msg) { block.run() } in assertThrows() 71 fun assertContainsExactly(actual: IntArray, vararg expected: Int) { in assertContainsExactly() 73 assertEquals(actual.sorted(), expected.sorted(), in assertContainsExactly() [all …]
|
/frameworks/base/tools/split-select/ |
D | Grouper_test.cpp | 104 Vector<const char*> expected; in expectHasGroupWithSplits() local 105 expected.add(a); in expectHasGroupWithSplits() 106 expectHasGroupWithSplits(expected); in expectHasGroupWithSplits() 110 Vector<const char*> expected; in expectHasGroupWithSplits() local 111 expected.add(a); in expectHasGroupWithSplits() 112 expected.add(b); in expectHasGroupWithSplits() 113 expectHasGroupWithSplits(expected); in expectHasGroupWithSplits() 117 Vector<const char*> expected; in expectHasGroupWithSplits() local 118 expected.add(a); in expectHasGroupWithSplits() 119 expected.add(b); in expectHasGroupWithSplits() [all …]
|
/frameworks/base/api/ |
D | api_versions_trimmer_unittests.py | 104 …expected = "dispatchGesture(Ljava/lang/Object;Landroid/accessibilityservice/AccessibilityService$G… 106 self.assertEqual(expected, method.get("name")) 114 …expected = "dispatchLeftGesture(Ljava/lang/Object;Landroid/accessibilityservice/AccessibilityServi… 116 self.assertEqual(expected, method.get("name")) 124 …expected = "dispatchGesture(Ljava/lang/Object;Landroid/accessibilityservice/AccessibilityService$G… 126 self.assertEqual(expected, method.get("name")) 134 …expected = "dispatchGesture(Ljava/lang/Object;Landroid/accessibilityservice/AccessibilityService$G… 136 self.assertEqual(expected, method.get("name")) 138 def _run_filter_db_test(self, database_str, expected): argument 158 expected = pretty_print(expected) [all …]
|
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ |
D | CallbackHandlerTest.java | 99 WifiIndicators expected = indicatorArg.getValue(); in testSignalCallback_setWifiIndicators() local 101 assertEquals(enabled, expected.enabled); in testSignalCallback_setWifiIndicators() 102 assertEquals(status, expected.statusIcon); in testSignalCallback_setWifiIndicators() 103 assertEquals(qs, expected.qsIcon); in testSignalCallback_setWifiIndicators() 104 assertEquals(in, expected.activityIn); in testSignalCallback_setWifiIndicators() 105 assertEquals(out, expected.activityOut); in testSignalCallback_setWifiIndicators() 106 assertEquals(description, expected.description); in testSignalCallback_setWifiIndicators() 107 assertTrue(expected.isTransient); in testSignalCallback_setWifiIndicators() 108 assertEquals(secondaryLabel, expected.statusLabel); in testSignalCallback_setWifiIndicators() 134 MobileDataIndicators expected = indicatorArg.getValue(); in testSignalCallback_setMobileDataIndicators() local [all …]
|
/frameworks/base/tools/protologtool/tests/com/android/protolog/tool/ |
D | CommandOptionsTest.kt | 45 @Test(expected = InvalidCommandException::class) 50 @Test(expected = InvalidCommandException::class) 74 @Test(expected = InvalidCommandException::class) 85 @Test(expected = InvalidCommandException::class) 95 @Test(expected = InvalidCommandException::class) 105 @Test(expected = InvalidCommandException::class) 115 @Test(expected = InvalidCommandException::class) 125 @Test(expected = InvalidCommandException::class) 136 @Test(expected = InvalidCommandException::class) 147 @Test(expected = InvalidCommandException::class) [all …]
|
/frameworks/base/startop/scripts/iorap/ |
D | compiler_test.py | 42 def assert_compile_result(output, expected, *extra_argv): argument 47 with open(output, 'rb') as f1, open(expected, 'rb') as f2: 52 expected = os.path.join(DIR, 58 with open(output, 'rb') as f1, open(expected, 'rb') as f2: 66 expected = os.path.join(DIR, 68 assert_compile_result(output, expected) 71 expected = os.path.join(DIR, 73 assert_compile_result(output, expected, '--duration', '10000') 76 expected = os.path.join(DIR, 78 assert_compile_result(output, expected, '--duration', '30000')
|
/frameworks/base/core/tests/coretests/src/android/text/ |
D | StaticLayoutDirectionsTest.java | 84 private static Directions[] expected = { field in StaticLayoutDirectionsTest 127 checkDirections(b.build(), i, b.text, expected, f); in testDirections() local 145 Directions expected = dirs(0, LVL1_1, 1, LVL2_1, 2, 3 | (1 << Layout.RUN_LEVEL_SHIFT)); in testTrailingWhitespace() local 146 expectDirections("split line", expected, result); in testTrailingWhitespace() 160 int[] expected = { 0, 1, 4, 3, 2, 5 }; in testNextToRightOf() local 163 for (int i = 1; i < expected.length; ++i) { in testNextToRightOf() 165 if (t != expected[i]) { in testNextToRightOf() 167 expected[i] + " got: " + t); in testNextToRightOf() 177 int[] expected = { 0, 1, 4, 3, 2, 5 }; in testNextToLeftOf() local 180 for (int i = expected.length - 1; --i >= 0;) { in testNextToLeftOf() [all …]
|
/frameworks/opt/setupwizard/library/test/instrumentation/src/com/android/setupwizardlib/test/ |
D | GlifPatternDrawableTest.java | 88 Matrix expected = new Matrix(canvas.getMatrix()); in testScaleToCanvasSquare() local 96 expected.postScale(0.5f, 0.5f); in testScaleToCanvasSquare() 98 assertEquals("Matrices should match", expected, canvas.getMatrix()); in testScaleToCanvasSquare() 104 final Matrix expected = new Matrix(canvas.getMatrix()); in testScaleToCanvasTall() local 112 expected.postScale(1f, 1f); in testScaleToCanvasTall() 113 expected.postTranslate(-99.718f, 0f); in testScaleToCanvasTall() 115 assertEquals("Matrices should match", expected, canvas.getMatrix()); in testScaleToCanvasTall() 121 final Matrix expected = new Matrix(canvas.getMatrix()); in testScaleToCanvasWide() local 129 expected.postScale(1f, 1f); in testScaleToCanvasWide() 130 expected.postTranslate(0f, -87.552f); in testScaleToCanvasWide() [all …]
|