Changeset 10002 in josm


Ignore:
Timestamp:
2016-03-17T01:56:30+01:00 (9 years ago)
Author:
Don-vip
Message:

sonar - User assertSame instead of assertTrue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java

    r9458 r10002  
    33
    44import static org.junit.Assert.assertFalse;
     5import static org.junit.Assert.assertNotSame;
     6import static org.junit.Assert.assertSame;
    57import static org.junit.Assert.assertTrue;
    68
     
    7779        timer = PerformanceTestUtils.startTimer("str1 == str2 succeeds");
    7880        for (int i = 0; i < STRING_INTERN_TESTS; i++) {
    79             assertTrue(str1Interned == str1InternedB);
     81            assertSame(str1Interned, str1InternedB);
    8082        }
    8183        timer.done();
     
    8385        timer = PerformanceTestUtils.startTimer("str1 == str2.intern() succeeds");
    8486        for (int i = 0; i < STRING_INTERN_TESTS; i++) {
    85             assertTrue(str1Interned == str1.intern());
     87            assertSame(str1Interned, str1.intern());
    8688        }
    8789        timer.done();
     
    8991        timer = PerformanceTestUtils.startTimer("str1 == str2.intern() succeeds for interned string");
    9092        for (int i = 0; i < STRING_INTERN_TESTS; i++) {
    91             assertTrue(str1Interned == str1InternedB.intern());
     93            assertSame(str1Interned, str1InternedB.intern());
    9294        }
    9395        timer.done();
     
    101103        timer = PerformanceTestUtils.startTimer("str1 == str2 fails");
    102104        for (int i = 0; i < STRING_INTERN_TESTS; i++) {
    103             assertFalse(str1Interned == str2Interned);
     105            assertNotSame(str1Interned, str2Interned);
    104106        }
    105107        timer.done();
     
    107109        timer = PerformanceTestUtils.startTimer("str1 == str2.intern() fails");
    108110        for (int i = 0; i < STRING_INTERN_TESTS; i++) {
    109             assertFalse(str1Interned == str2.intern());
     111            assertNotSame(str1Interned, str2.intern());
    110112        }
    111113        timer.done();
Note: See TracChangeset for help on using the changeset viewer.