}
public void testEqualsMatches_YUVFormat()
{
final YUVFormat f1 = new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6);
// YUVFormat - equal and match:
{
final YUVFormat[] f2s = new YUVFormat[]{
new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6),
(YUVFormat) f1.clone(),
(YUVFormat) f1.intersects(f1)
};
for (int i = 0; i < f2s.length; ++i)
{
YUVFormat f2 = f2s[i];
assertTrue(f1.equals(f2));
assertTrue(f1.matches(f2));
assertTrue(f2.equals(f1));
assertTrue(f2.matches(f1));
}
}
// YUVFormat - not equal and not match:
{
final YUVFormat[] f2s = new YUVFormat[]{
new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_411, 2, 3, 4, 5, 6),
new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 12, 3, 4, 5, 6),
new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 13, 4, 5, 6),
new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 14, 5, 6),
new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 15, 6),
new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 16),
};
for (int i = 0; i < f2s.length; ++i)
{
YUVFormat f2 = f2s[i];
//System.out.println(f2);
assertFalse(f1.equals(f2));
assertFalse(f1.matches(f2));
assertFalse(f2.equals(f1));
assertFalse(f2.matches(f1));
}
}
// YUVFormat - not equal but match:
{
final YUVFormat[] f2s = new YUVFormat[]{
new YUVFormat(null, 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6),
new YUVFormat(new java.awt.Dimension(120, 200), Format.NOT_SPECIFIED, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6),
new YUVFormat(new java.awt.Dimension(120, 200), 1000, null, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6),
new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, Format.NOT_SPECIFIED, YUVFormat.YUV_111, 2, 3, 4, 5, 6),
new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, Format.NOT_SPECIFIED, 2, 3, 4, 5, 6),
new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, Format.NOT_SPECIFIED, 3, 4, 5, 6),
new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, Format.NOT_SPECIFIED, 4, 5, 6),
new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, Format.NOT_SPECIFIED, 5, 6),
new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, Format.NOT_SPECIFIED, 6),
new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, Format.NOT_SPECIFIED),
};
for (int i = 0; i < f2s.length; ++i)
{
YUVFormat f2 = f2s[i];
//System.out.println(f2);
assertFalse(f1.equals(f2));
assertTrue(f1.matches(f2));
assertFalse(f2.equals(f1));
assertTrue(f2.matches(f1));
}
}
}