am 2bd65db1: Layoutlib tests now check methods return value [DO NOT MERGE]

* commit '2bd65db15fa6a265ccc4023161611088bc791b4e':
  Layoutlib tests now check methods return value [DO NOT MERGE]
This commit is contained in:
Deepanshu Gupta
2014-05-13 01:49:21 +00:00
committed by Android Git Automerger
2 changed files with 11 additions and 1 deletions

View File

@@ -253,8 +253,9 @@ public final class Bitmap_Delegate {
} }
@LayoutlibDelegate @LayoutlibDelegate
/*package*/ static void nativeRecycle(int nativeBitmap) { /*package*/ static boolean nativeRecycle(int nativeBitmap) {
sManager.removeJavaReferenceFor(nativeBitmap); sManager.removeJavaReferenceFor(nativeBitmap);
return true;
} }
@LayoutlibDelegate @LayoutlibDelegate

View File

@@ -129,6 +129,15 @@ public class TestDelegates extends TestCase {
originalClass.getName()), originalClass.getName()),
delegateMethod.getAnnotation(LayoutlibDelegate.class)); 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 // check that the method is static
assertTrue( assertTrue(
String.format( String.format(