mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-15 08:34:30 +02:00
8287661: Fix and improve BitMap::print_on(outputStream*)
Reviewed-by: stefank
This commit is contained in:
parent
b544b8b7d4
commit
625821dae7
2 changed files with 36 additions and 3 deletions
|
@ -22,6 +22,7 @@
|
|||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "logging/logStream.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "utilities/bitMap.inline.hpp"
|
||||
#include "unittest.hpp"
|
||||
|
@ -95,6 +96,21 @@ class BitMapTest {
|
|||
EXPECT_TRUE(map.is_same(map2)) << "With init_size " << init_size;
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
||||
static void testPrintOn(BitMap::idx_t size) {
|
||||
ResourceMark rm;
|
||||
|
||||
ResourceBitMap map(size);
|
||||
if (size > 0) {
|
||||
map.set_bit(size / 2);
|
||||
}
|
||||
|
||||
LogStreamHandle(Info, test) stream;
|
||||
map.print_on(&stream);
|
||||
}
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
TEST_VM(BitMap, resize_grow) {
|
||||
|
@ -148,3 +164,13 @@ TEST_VM(BitMap, reinitialize) {
|
|||
BitMapTest::testReinitialize(BitMapTest::BITMAP_SIZE >> 3);
|
||||
BitMapTest::testReinitialize(BitMapTest::BITMAP_SIZE);
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
||||
TEST_VM(BitMap, print_on) {
|
||||
BitMapTest::testPrintOn(0);
|
||||
BitMapTest::testPrintOn(BitMapTest::BITMAP_SIZE >> 3);
|
||||
BitMapTest::testPrintOn(BitMapTest::BITMAP_SIZE);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue