harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Loenko" <mloe...@gmail.com>
Subject duplicate tests (was: RE: svn commit: r395188 - in /incuba...)
Date Wed, 19 Apr 2006 09:56:23 GMT
Hello

I've added a couple of regression tests to
test/java/tests/api/java/io/RandomAccessFileTest.java
and a bit reorganized remaining tests to get them close to conventions
we discussed somewhere here recently.

I've noticed that there are tests that are looking very similar, for example:

/**
  * @tests java.io.RandomAccessFile#readBoolean()
*/
public void test_readBoolean() throws IOException {
    // Test for method boolean java.io.RandomAccessFile.readBoolean()
    RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
    raf.writeBoolean(true);
    raf.seek(0);
    assertTrue("Incorrect boolean read/written", raf.readBoolean());
    raf.close();
}

and


/**
* @tests java.io.RandomAccessFile#writeBoolean(boolean)
*/
public void test_writeBooleanZ() throws IOException {
    // Test for method void java.io.RandomAccessFile.writeBoolean(boolean)
    RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
    raf.writeBoolean(true);
    raf.seek(0);
    assertTrue("Incorrect boolean read/written", raf.readBoolean());
    raf.close();
}

I understand that in general we might have couples of equivalent tests that
designed to test different scenarios (because when we change one of those tests
the second one still cover the second scenario...), but do we need this kind of
duplication here?

Thanks,
Mikhail

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message