From dfc19cd63a1cab8639c4e3150d08e8cf6cfe1241 Mon Sep 17 00:00:00 2001 From: Frankie Sardo Date: Tue, 31 May 2016 14:00:27 +0100 Subject: [PATCH] Add zero properties test --- test/auto_parcel/core_test.clj | 4 +++ test/test/zero/$AutoValue_Test.java | 6 +++++ test/test/zero/AutoValue_Test.java | 39 +++++++++++++++++++++++++++++ test/test/zero/Test.java | 9 +++++++ 4 files changed, 58 insertions(+) create mode 100644 test/test/zero/$AutoValue_Test.java create mode 100644 test/test/zero/AutoValue_Test.java create mode 100644 test/test/zero/Test.java diff --git a/test/auto_parcel/core_test.clj b/test/auto_parcel/core_test.clj index 6275871..10e03ce 100644 --- a/test/auto_parcel/core_test.clj +++ b/test/auto_parcel/core_test.clj @@ -44,6 +44,10 @@ (.generatesSources first (into-array JavaFileObject rest))))))) (deftest simple + (testing "zero properties" + (check-compiles + "test.zero.Test" + "test.zero.AutoValue_Test")) (testing "one property" (check-compiles "test.one.Test" diff --git a/test/test/zero/$AutoValue_Test.java b/test/test/zero/$AutoValue_Test.java new file mode 100644 index 0000000..54e8c97 --- /dev/null +++ b/test/test/zero/$AutoValue_Test.java @@ -0,0 +1,6 @@ +package test.zero; + +public abstract class $AutoValue_Test extends Test { + public $AutoValue_Test() { + } +} diff --git a/test/test/zero/AutoValue_Test.java b/test/test/zero/AutoValue_Test.java new file mode 100644 index 0000000..1443acb --- /dev/null +++ b/test/test/zero/AutoValue_Test.java @@ -0,0 +1,39 @@ +package test.zero; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.lang.ClassLoader; + +final class AutoValue_Test extends $AutoValue_Test { + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + @Override + public AutoValue_Test createFromParcel(Parcel in) { + return new AutoValue_Test(in); + } + + @Override + public AutoValue_Test[] newArray(int size) { + return new AutoValue_Test[size]; + } + }; + private final static ClassLoader CL = AutoValue_Test.class.getClassLoader(); + + public AutoValue_Test() { + super(); + } + + private AutoValue_Test(Parcel in) { + this(); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + + } +} diff --git a/test/test/zero/Test.java b/test/test/zero/Test.java new file mode 100644 index 0000000..942a43a --- /dev/null +++ b/test/test/zero/Test.java @@ -0,0 +1,9 @@ +package test.zero; + +import com.google.auto.value.AutoValue; +import android.os.Parcelable; + +public +@AutoValue +abstract class Test implements Parcelable { +} \ No newline at end of file