#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2015-2019, Intel Corporation

#
# src/test/obj_realloc/TEST1 -- unit test for pmemobj_realloc and
# pmemobj_zrealloc
#

. ../unittest/unittest.sh

require_test_type long

# XXX reduce the number of reallocs performed under pmemcheck so that the
# execution time is reasonable and within the time limit (5 minutes) on both
# pmem and non-pmem fs types.
require_fs_type non-pmem

configure_valgrind pmemcheck force-enable
setup

expect_normal_exit $PMEMPOOL$EXESUFFIX\
	create obj --layout realloc --size=512M $DIR/testfile1

# last parameter disables integrity tests, because they are veeeeeery slow
# under pmemcheck (19 minutes vs 7 seconds)
# XXX enable after pmemcheck optimization
expect_normal_exit ./obj_realloc$EXESUFFIX $DIR/testfile1 0

check

pass
