}
}
public void testEqualsMatches_H263Format()
{
final H263Format f1 = new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6);
// equal and match:
{
final H263Format[] f2s = new H263Format[]{
new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6),
(H263Format) f1.clone(),
(H263Format) f1.intersects(f1)
};
for (int i = 0; i < f2s.length; ++i)
{
H263Format f2 = f2s[i];
assertTrue(f1.equals(f2));
assertTrue(f1.matches(f2));
assertTrue(f2.equals(f1));
assertTrue(f2.matches(f1));
}
}
// not equal and not match:
{
final H263Format[] f2s = new H263Format[]{
new H263Format(new Dimension(1, 2), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6),
new H263Format(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6),
new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 3.f, 1, 2, 3, 4, 5, 6),
new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 11, 2, 3, 4, 5, 6),
new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 12, 3, 4, 5, 6),
new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 13, 4, 5, 6),
new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 14, 5, 6),
new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 15, 6),
new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 16),
};
for (int i = 0; i < f2s.length; ++i)
{
H263Format f2 = f2s[i];
//System.out.println(f2);
assertFalse(f1.equals(f2));
assertFalse(f1.matches(f2));
assertFalse(f2.equals(f1));
assertFalse(f2.matches(f1));
}
}
// not equal but match:
{
final H263Format[] f2s = new H263Format[]{
new H263Format(new Dimension(1, 1), 2001, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6),
new H263Format(null, 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6),
new H263Format(new Dimension(1, 1), Format.NOT_SPECIFIED, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6),
new H263Format(new Dimension(1, 1), 2000, null, 2.f, 1, 2, 3, 4, 5, 6),
new H263Format(new Dimension(1, 1), 2000, Format.shortArray, Format.NOT_SPECIFIED, 1, 2, 3, 4, 5, 6),
new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, Format.NOT_SPECIFIED, 2, 3, 4, 5, 6),
new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, Format.NOT_SPECIFIED, 3, 4, 5, 6),
new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, Format.NOT_SPECIFIED, 4, 5, 6),
new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, Format.NOT_SPECIFIED, 5, 6),
new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, Format.NOT_SPECIFIED, 6),
new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, Format.NOT_SPECIFIED),
};
for (int i = 0; i < f2s.length; ++i)
{
H263Format f2 = f2s[i];
//System.out.println(f2);
assertFalse(f1.equals(f2));
assertTrue(f1.matches(f2));
assertFalse(f2.equals(f1));
assertTrue(f2.matches(f1));
}
}
}