Skip to content

Commit c99aa8f

Browse files
committed
harden mem usage test
1 parent d1ff0e8 commit c99aa8f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/tests/conduit/t_conduit_utils.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,9 +922,15 @@ TEST(conduit_utils, memory_usage)
922922
{
923923
index_t prev_usage = conduit::utils::memory_usage();
924924

925-
// alloc two mB
925+
// alloc 5 mB
926926
Node n;
927-
n.set(DataType::uint8(2097152));
927+
n.set(DataType::uint8(5*1024*1024));
928+
// touch memory to make sure it is actually used
929+
uint8_array vals = n.value();
930+
for(index_t i=0;i<vals.number_of_elements();i++)
931+
{
932+
vals[i] = i % 256;
933+
}
928934

929935
index_t curr_usage = conduit::utils::memory_usage();
930936

0 commit comments

Comments
 (0)