use of com.bumptech.glide.signature.ObjectKey in project glide by bumptech.
the class RequestOptionsTest method testEqualsHashCode.
@Test
public void testEqualsHashCode() {
Drawable first = new ColorDrawable(Color.RED);
Drawable second = new GradientDrawable();
assertThat(first).isNotEqualTo(second);
assertThat(Util.bothNullOrEqual(first, second)).isFalse();
new EqualsTester().addEqualityGroup(new RequestOptions().sizeMultiplier(.7f), new RequestOptions().sizeMultiplier(.7f)).addEqualityGroup(new RequestOptions().sizeMultiplier(0.8f)).addEqualityGroup(new RequestOptions().error(1), new RequestOptions().error(1)).addEqualityGroup(new RequestOptions().error(2)).addEqualityGroup(new RequestOptions().error(first), new RequestOptions().error(first)).addEqualityGroup(new RequestOptions().error(second)).addEqualityGroup(new RequestOptions().placeholder(1), new RequestOptions().placeholder(1)).addEqualityGroup(new RequestOptions().placeholder(2)).addEqualityGroup(new RequestOptions().placeholder(first), new RequestOptions().placeholder(first)).addEqualityGroup(new RequestOptions().placeholder(second)).addEqualityGroup(new RequestOptions().fallback(1), new RequestOptions().fallback(1)).addEqualityGroup(new RequestOptions().fallback(2)).addEqualityGroup(new RequestOptions().fallback(first), new RequestOptions().fallback(first)).addEqualityGroup(new RequestOptions().fallback(second)).addEqualityGroup(new RequestOptions().skipMemoryCache(true), new RequestOptions().skipMemoryCache(true)).addEqualityGroup(new RequestOptions(), new RequestOptions().skipMemoryCache(false), new RequestOptions().theme(null), new RequestOptions().onlyRetrieveFromCache(false), new RequestOptions().useUnlimitedSourceGeneratorsPool(false)).addEqualityGroup(new RequestOptions().override(100), new RequestOptions().override(100, 100)).addEqualityGroup(new RequestOptions().override(200), new RequestOptions().override(200, 200)).addEqualityGroup(new RequestOptions().override(100, 200), new RequestOptions().override(100, 200)).addEqualityGroup(new RequestOptions().override(200, 100), new RequestOptions().override(200, 100)).addEqualityGroup(new RequestOptions().centerCrop(), new RequestOptions().centerCrop()).addEqualityGroup(new RequestOptions().optionalCenterCrop(), new RequestOptions().optionalCenterCrop()).addEqualityGroup(new RequestOptions().fitCenter()).addEqualityGroup(new RequestOptions().circleCrop()).addEqualityGroup(new RequestOptions().centerInside()).addEqualityGroup(new RequestOptions().useUnlimitedSourceGeneratorsPool(true), new RequestOptions().useUnlimitedSourceGeneratorsPool(true)).addEqualityGroup(new RequestOptions().onlyRetrieveFromCache(true), new RequestOptions().onlyRetrieveFromCache(true)).addEqualityGroup(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.ALL), new RequestOptions().diskCacheStrategy(DiskCacheStrategy.ALL)).addEqualityGroup(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.NONE)).addEqualityGroup(new RequestOptions().priority(Priority.HIGH), new RequestOptions().priority(Priority.HIGH)).addEqualityGroup(new RequestOptions().priority(Priority.LOW)).addEqualityGroup(new RequestOptions().set(Option.memory("test"), true), new RequestOptions().set(Option.memory("test"), true)).addEqualityGroup(new RequestOptions().set(Option.memory("test"), false)).addEqualityGroup(new RequestOptions().set(Option.memory("test2"), true)).addEqualityGroup(new RequestOptions().decode(Integer.class), new RequestOptions().decode(Integer.class)).addEqualityGroup(new RequestOptions().decode(Float.class)).addEqualityGroup(new RequestOptions().signature(new ObjectKey("test")), new RequestOptions().signature(new ObjectKey("test"))).addEqualityGroup(new RequestOptions().signature(new ObjectKey("test2"))).addEqualityGroup(new RequestOptions().theme(app.getTheme()), new RequestOptions().theme(app.getTheme())).testEquals();
}
Aggregations