}
public void testEqualsMatches_H261Format()
{
final H261Format f1 = new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1);
// H261Format - equal and match:
{
final H261Format[] f2s = new H261Format[]{
new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1),
(H261Format) f1.clone(),
(H261Format) f1.intersects(f1)
};
for (int i = 0; i < f2s.length; ++i)
{
H261Format f2 = f2s[i];
assertTrue(f1.equals(f2));
assertTrue(f1.matches(f2));
assertTrue(f2.equals(f1));
assertTrue(f2.matches(f1));
}
}
// H261Format - not equal and not match:
{
final H261Format[] f2s = new H261Format[]{
new H261Format(new Dimension(1, 2), 2000, Format.byteArray, 3.f, 1),
new H261Format(new Dimension(1, 1), 2000, Format.intArray, 3.f, 1),
new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 4.f, 1),
new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 11),
};
for (int i = 0; i < f2s.length; ++i)
{
H261Format f2 = f2s[i];
//System.out.println(f2);
assertFalse(f1.equals(f2));
assertFalse(f1.matches(f2));
assertFalse(f2.equals(f1));
assertFalse(f2.matches(f1));
}
}
// H261Format - not equal but match:
{
final H261Format[] f2s = new H261Format[]{
new H261Format(new Dimension(1, 1), 3000, Format.byteArray, 3.f, 1),
new H261Format(null, 2000, Format.byteArray, 3.f, 1),
new H261Format(new Dimension(1, 1), Format.NOT_SPECIFIED, Format.byteArray, 3.f, 1),
new H261Format(new Dimension(1, 1), 2000, null, 3.f, 1),
new H261Format(new Dimension(1, 1), 2000, Format.byteArray, Format.NOT_SPECIFIED, 1),
new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 3.f, Format.NOT_SPECIFIED),
};
for (int i = 0; i < f2s.length; ++i)
{
H261Format f2 = f2s[i];
//System.out.println(f2);
assertFalse(f1.equals(f2));
assertTrue(f1.matches(f2));
assertFalse(f2.equals(f1));
assertTrue(f2.matches(f1));
}
}
}