public void testFieldDuplication()
{
{
final Dimension d = new Dimension(100, 200);
final VideoFormat f1 = new VideoFormat("abc", d, 2000, int[].class, 2.f);
final VideoFormat f2 = (VideoFormat) f1.clone();
assertTrue(f1.getSize().equals(d));
assertTrue(f1.getSize() != d);
assertTrue(f1.getSize() != f2.getSize());
assertTrue(f1.getSize().equals(f2.getSize()));
}
{
final VideoFormat f1 = new VideoFormat("abc", new Dimension(100, 200), 2000, int[].class, 2.f);
final VideoFormat f2 = (VideoFormat) f1.relax();
assertTrue(f1.getSize() != f2.getSize());
assertTrue(f2.getSize() == null);
}
{
final VideoFormat f1 = new VideoFormat("abc", new Dimension(100, 200), 2000, int[].class, 2.f);
final VideoFormat f2 = (VideoFormat) f1.intersects(f1);
assertTrue(f1.getSize() == f2.getSize());
assertTrue(f1.getSize().equals(f2.getSize()));
}
{
final VideoFormat f1 = new VideoFormat("abc", new Dimension(100, 200), 2000, int[].class, 2.f);
final VideoFormat f2 = new VideoFormat("abc", new Dimension(100, 201), 2000, int[].class, 2.f);
final VideoFormat f3 = (VideoFormat) f1.intersects(f2);
assertTrue(f1.getSize() == f3.getSize());
assertTrue(f1.getSize().equals(f3.getSize()));
}
{
final VideoFormat f1 = new VideoFormat("abc", null, 2000, int[].class, 2.f);
final VideoFormat f2 = new VideoFormat("abc", new Dimension(100, 201), 2000, int[].class, 2.f);
final VideoFormat f3 = (VideoFormat) f1.intersects(f2);
assertTrue(f3.getSize() == f2.getSize());
}
{
final Format f1 = new Format("abc");
final VideoFormat f2 = new VideoFormat("abc", new Dimension(100, 201), 2000, int[].class, 2.f);
final VideoFormat f3 = (VideoFormat) f1.intersects(f2);
final VideoFormat f4 = (VideoFormat) f2.intersects(f1);
assertTrue(f3.getSize() != f2.getSize());
assertTrue(f4.getSize() != f2.getSize());
}
{