public void testConstructor2(TestHarness harness)
{
harness.checkPoint("(char[], int, int)");
char[] ch = new char[] {'A', 'B', 'C'};
Segment s = new Segment(ch, 1, 2);
harness.check(s.offset, 1);
harness.check(s.count, 2);
harness.check(s.array, ch);
harness.check(s.toString(), "BC");
harness.check(s.getIndex(), 0);
harness.check(s.getBeginIndex(), 1);
harness.check(s.getEndIndex(), 3);
// try offset out of range - this creates an instance with a bad state
s = new Segment(ch, 4, 1);
harness.check(s.offset, 4);
harness.check(s.count, 1);
harness.check(s.array, ch);
// null array
s = new Segment(null, 0, 1);
harness.check(s.offset, 0);
harness.check(s.count, 1);
harness.check(s.array, null);
// negative offsets
s = new Segment(ch, -4, 1);
harness.check(s.offset, -4);
harness.check(s.count, 1);
harness.check(s.array, ch);
}