Home
last modified time | relevance | path

Searched refs:expected (Results 1 – 25 of 555) sorted by relevance

12345678910>>...23

/frameworks/base/test-base/src/junit/framework/
DAssert.java62 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/
DTextClassifierEventTest.java49 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/
Dserialization_tests.cpp117 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/
DCpuFrequenciesTest.java34 private void check(ArrayMap<String, String> expected, String config) { in check() argument
35 assertEquals(expected, (new CpuFrequencies().parseString(config)) 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/services/tests/uiservicestests/src/com/android/server/notification/
DValidateNotificationPeopleTest.java50 String[] expected = { "foobar" }; in testSingleString() local
52 bundle.putString(Notification.EXTRA_PEOPLE_LIST, expected[0]); in testSingleString()
54 assertStringArrayEquals("string should be in result[0]", expected, result); in testSingleString()
59 String[] expected = { "foobar" }; in testSingleCharArray() local
61 bundle.putCharArray(Notification.EXTRA_PEOPLE_LIST, expected[0].toCharArray()); in testSingleCharArray()
63 assertStringArrayEquals("char[] should be in result[0]", expected, result); in testSingleCharArray()
68 String[] expected = { "foobar" }; in testSingleCharSequence() local
70 bundle.putCharSequence(Notification.EXTRA_PEOPLE_LIST, new SpannableString(expected[0])); in testSingleCharSequence()
72 assertStringArrayEquals("charSequence should be in result[0]", expected, result); in testSingleCharSequence()
78 String[] expected = { "foobar" }; in testStringArraySingle() local
[all …]
DGlobalSortKeyComparatorTest.java71 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/wifi/tests/src/android/net/wifi/
DWifiUsabilityStatsEntryTest.java83 WifiUsabilityStatsEntry expected, in assertWifiUsabilityStatsEntryEquals() argument
85 assertEquals(expected.getTimeStampMillis(), actual.getTimeStampMillis()); in assertWifiUsabilityStatsEntryEquals()
86 assertEquals(expected.getRssi(), actual.getRssi()); in assertWifiUsabilityStatsEntryEquals()
87 assertEquals(expected.getLinkSpeedMbps(), actual.getLinkSpeedMbps()); in assertWifiUsabilityStatsEntryEquals()
88 assertEquals(expected.getTotalTxSuccess(), actual.getTotalTxSuccess()); in assertWifiUsabilityStatsEntryEquals()
89 assertEquals(expected.getTotalTxRetries(), actual.getTotalTxRetries()); in assertWifiUsabilityStatsEntryEquals()
90 assertEquals(expected.getTotalTxBad(), actual.getTotalTxBad()); in assertWifiUsabilityStatsEntryEquals()
91 assertEquals(expected.getTotalRxSuccess(), actual.getTotalRxSuccess()); in assertWifiUsabilityStatsEntryEquals()
92 assertEquals(expected.getTotalRadioOnTimeMillis(), actual.getTotalRadioOnTimeMillis()); in assertWifiUsabilityStatsEntryEquals()
93 assertEquals(expected.getTotalRadioTxTimeMillis(), actual.getTotalRadioTxTimeMillis()); in assertWifiUsabilityStatsEntryEquals()
[all …]
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/
DWifiConfigurationTestUtil.java547 WifiConfiguration expected, WifiConfiguration actual) { in assertCommonConfigurationElementsEqual() argument
548 assertNotNull(expected); in assertCommonConfigurationElementsEqual()
550 assertEquals(expected.SSID, actual.SSID); in assertCommonConfigurationElementsEqual()
551 assertEquals(expected.BSSID, actual.BSSID); in assertCommonConfigurationElementsEqual()
552 assertEquals(expected.preSharedKey, actual.preSharedKey); in assertCommonConfigurationElementsEqual()
553 assertEquals(expected.wepKeys, actual.wepKeys); in assertCommonConfigurationElementsEqual()
554 assertEquals(expected.wepTxKeyIndex, actual.wepTxKeyIndex); in assertCommonConfigurationElementsEqual()
555 assertEquals(expected.hiddenSSID, actual.hiddenSSID); in assertCommonConfigurationElementsEqual()
556 assertEquals(expected.requirePMF, actual.requirePMF); in assertCommonConfigurationElementsEqual()
557 assertEquals(expected.allowedKeyManagement, actual.allowedKeyManagement); in assertCommonConfigurationElementsEqual()
[all …]
DScanTestUtil.java295 String prefix, ScanResult expected, ScanResult actual) { in assertScanResultEquals() argument
296 assertEquals(prefix + "SSID", expected.SSID, actual.SSID); in assertScanResultEquals()
297 assertEquals(prefix + "wifiSsid", expected.wifiSsid.toString(), actual.wifiSsid.toString()); in assertScanResultEquals()
298 assertEquals(prefix + "BSSID", expected.BSSID, actual.BSSID); in assertScanResultEquals()
299 assertEquals(prefix + "capabilities", expected.capabilities, actual.capabilities); in assertScanResultEquals()
300 assertEquals(prefix + "level", expected.level, actual.level); in assertScanResultEquals()
301 assertEquals(prefix + "frequency", expected.frequency, actual.frequency); in assertScanResultEquals()
302 assertEquals(prefix + "timestamp", expected.timestamp, actual.timestamp); in assertScanResultEquals()
303 assertEquals(prefix + "seen", expected.seen, actual.seen); in assertScanResultEquals()
306 private static void assertScanResultsEquals(String prefix, ScanResult[] expected, in assertScanResultsEquals() argument
[all …]
DWifiMetricsTestUtil.java42 public static void assertHistogramBucketsEqual(HistogramBucketInt32[] expected, in assertHistogramBucketsEqual() argument
44 assertEquals("Number of buckets do not match!", expected.length, actual.length); in assertHistogramBucketsEqual()
46 for (int i = 0; i < expected.length; i++) { in assertHistogramBucketsEqual()
47 HistogramBucketInt32 expectedBucket = expected[i]; in assertHistogramBucketsEqual()
74 public static void assertKeyCountsEqual(Int32Count[] expected, Int32Count[] actual) { in assertKeyCountsEqual() argument
75 assertEquals("Number of key counts do not match!", expected.length, actual.length); in assertKeyCountsEqual()
77 for (int i = 0; i < expected.length; i++) { in assertKeyCountsEqual()
78 Int32Count expectedKeyCount = expected[i]; in assertKeyCountsEqual()
103 LinkProbeFailureReasonCount[] expected, LinkProbeFailureReasonCount[] actual) { in assertLinkProbeFailureReasonCountsEqual() argument
105 expected.length, actual.length); in assertLinkProbeFailureReasonCountsEqual()
[all …]
/frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/
DCameraErrorCollector.java147 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/
DMoreAsserts.java46 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/
DPasswordSlotManagerTests.java59 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 …]
/frameworks/native/libs/vr/libdvrcommon/include/private/dvr/test/
Dtest_macros.h16 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/
Dih_util_test.cpp29 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 …]
DSystemPropertiesParser_test.cpp55 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 …]
DProcrankParser_test.cpp55 ProcrankProto expected; in TEST_F() local
57 ProcrankProto::Process* process1 = expected.add_processes(); in TEST_F()
69 ProcrankProto::Process* process2 = expected.add_processes(); in TEST_F()
81 ProcrankProto::Process* total = expected.mutable_summary()->mutable_total(); in TEST_F()
90 expected.mutable_summary()->mutable_zram() in TEST_F()
92 expected.mutable_summary()->mutable_ram() in TEST_F()
100 EXPECT_EQ(GetCapturedStdout(), expected.SerializeAsString()); in TEST_F()
107 ProcrankProto expected; in TEST_F() local
109 ProcrankProto::Process* process1 = expected.add_processes(); in TEST_F()
117 ProcrankProto::Process* process2 = expected.add_processes(); in TEST_F()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/
DPackageInstallerSessionTest.java255 private void assertSessionParamsEquivalent(PackageInstaller.SessionParams expected, in assertSessionParamsEquivalent() argument
257 assertEquals(expected.mode, actual.mode); in assertSessionParamsEquivalent()
258 assertEquals(expected.installFlags, actual.installFlags); in assertSessionParamsEquivalent()
259 assertEquals(expected.installLocation, actual.installLocation); in assertSessionParamsEquivalent()
260 assertEquals(expected.installReason, actual.installReason); in assertSessionParamsEquivalent()
261 assertEquals(expected.sizeBytes, actual.sizeBytes); in assertSessionParamsEquivalent()
262 assertEquals(expected.appPackageName, actual.appPackageName); in assertSessionParamsEquivalent()
263 assertEquals(expected.appIcon, actual.appIcon); in assertSessionParamsEquivalent()
264 assertEquals(expected.originatingUri, actual.originatingUri); in assertSessionParamsEquivalent()
265 assertEquals(expected.originatingUid, actual.originatingUid); in assertSessionParamsEquivalent()
[all …]
/frameworks/base/tools/split-select/
DGrouper_test.cpp104 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/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/hotspot2/
DUtilsTest.java34 String expected = "000001, 000002, 0000800000"; in testRoamingConsortiumsToStringLong() local
36 assertEquals(expected, result); in testRoamingConsortiumsToStringLong()
47 String expected = "000001, 000002, 0000800000"; in testRoamingConsortiumsToStringCollection() local
49 assertEquals(expected, result); in testRoamingConsortiumsToStringCollection()
75 String expected = "ab cd ef"; in testToHexString() local
77 assertEquals(expected, result.toLowerCase()); in testToHexString()
85 String expected = "abcdef"; in testToHex() local
87 assertEquals(expected, result.toLowerCase()); in testToHex()
96 byte[] expected = {(byte) 0xab, (byte) 0xcd}; in testHexToBytes()
98 assertArrayEquals(expected, result); in testHexToBytes()
[all …]
/frameworks/opt/setupwizard/library/test/instrumentation/src/com/android/setupwizardlib/test/
DGlifPatternDrawableTest.java88 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 …]
/frameworks/base/core/tests/coretests/src/android/text/
DStaticLayoutDirectionsTest.java84 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/base/tests/net/common/java/android/net/
DStaticIpConfigurationTest.java144 LinkProperties expected = new LinkProperties(); in testToLinkProperties() local
145 expected.setInterfaceName(IFACE); in testToLinkProperties()
148 assertEquals(expected, s.toLinkProperties(IFACE)); in testToLinkProperties()
152 expected.addLinkAddress(ADDR); in testToLinkProperties()
153 expected.addRoute(connectedRoute); in testToLinkProperties()
154 assertEquals(expected, s.toLinkProperties(IFACE)); in testToLinkProperties()
158 expected.addRoute(defaultRoute); in testToLinkProperties()
159 assertEquals(expected, s.toLinkProperties(IFACE)); in testToLinkProperties()
162 expected.removeRoute(defaultRoute); in testToLinkProperties()
164 expected.addRoute(defaultRoute); in testToLinkProperties()
[all …]
/frameworks/libs/net/common/hostdevice/com/android/testutils/
DMiscAsserts.kt33 fun <T> assertLength(expected: Int, got: Array<T>) = got.size.let { len -> in len()
34 assertEquals(expected, len, "Expected array of length $expected, but was $len for $got") in len()
39 fun <T : Exception> assertThrows(expected: Class<T>, block: ThrowingRunnable): T { in assertThrows()
40 return assertFailsWith(expected.kotlin) { block.run() } in assertThrows()
43 fun <T : Exception> assertThrows(msg: String, expected: Class<T>, block: ThrowingRunnable): T { in assertThrows()
44 return assertFailsWith(expected.kotlin, msg) { block.run() } in assertThrows()
61 fun assertContainsExactly(actual: IntArray, vararg expected: Int) { in assertContainsExactly()
63 assertEquals(actual.sorted(), expected.sorted(), in assertContainsExactly()
64 "$actual does not contain exactly $expected") in assertContainsExactly()
67 fun assertContainsStringsExactly(actual: Array<String>, vararg expected: String) { in assertContainsStringsExactly()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/
DSigXmlTest.java67 CertValidationException expected = in parseAndVerifyFileSignature_throwsIfInvalidSignature() local
74 assertThat(expected.getMessage()).contains("signature is invalid"); in parseAndVerifyFileSignature_throwsIfInvalidSignature()
96 CertParsingException expected = in parse_throwsIfNoSignerCert() local
103 assertThat(expected.getMessage()).contains("exactly one"); in parse_throwsIfNoSignerCert()
108 CertParsingException expected = in parse_throwsIfTwoSignerCerts() local
115 assertThat(expected.getMessage()).contains("exactly one"); in parse_throwsIfTwoSignerCerts()
120 CertParsingException expected = in parse_throwsIfNoSignatureValue() local
127 assertThat(expected.getMessage()).contains("exactly one"); in parse_throwsIfNoSignatureValue()
132 CertParsingException expected = in parse_throwsIfTwoSignatureValues() local
139 assertThat(expected.getMessage()).contains("exactly one"); in parse_throwsIfTwoSignatureValues()

12345678910>>...23