summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2014-04-15 19:30:35 -0700
committerDeepanshu Gupta <deepanshu@google.com>2014-05-06 14:02:47 -0700
commitd915dcac365b6d3ad88afab52e74ccca7dfbefec (patch)
tree710d6a26fdb4ac0e04cf3a63bccf751942ad30c4 /tools
parent877ae53586c3f7f5b788a40dfb0a58bef54a7446 (diff)
downloadframeworks_base-d915dcac365b6d3ad88afab52e74ccca7dfbefec.zip
frameworks_base-d915dcac365b6d3ad88afab52e74ccca7dfbefec.tar.gz
frameworks_base-d915dcac365b6d3ad88afab52e74ccca7dfbefec.tar.bz2
Layoutlib tests now check methods return value [DO NOT MERGE]
The change is a cherry-pick from klp-dev. The change also fixes the errors found by fixing the tests. Change-Id: I87cef323c4eaee4e9f60475f01156b276593fa50 (cherry-picked from commit 2bd65db15fa6a265ccc4023161611088bc791b4e)
Diffstat (limited to 'tools')
-rw-r--r--tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/TestDelegates.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/TestDelegates.java b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/TestDelegates.java
index d3218db..7c0bc84 100644
--- a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/TestDelegates.java
+++ b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/TestDelegates.java
@@ -129,6 +129,15 @@ public class TestDelegates extends TestCase {
originalClass.getName()),
delegateMethod.getAnnotation(LayoutlibDelegate.class));
+ // check the return type of the methods match.
+ assertTrue(
+ String.format("Delegate method %1$s.%2$s does not match the corresponding " +
+ "framework method which returns %3$s",
+ delegateClass.getName(),
+ getMethodName(delegateMethod),
+ originalMethod.getReturnType().getName()),
+ delegateMethod.getReturnType() == originalMethod.getReturnType());
+
// check that the method is static
assertTrue(
String.format(