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

#
# src/test/ex_libpmemobj/TEST1 -- unit test for libpmemobj examples
#

. ../unittest/unittest.sh

require_test_type medium

require_build_type debug nondebug

setup

. ./common.sh

EX_PATH=../../examples/libpmemobj

expect_normal_exit $EX_PATH/btree $DIR/testfile1 i 1234 foo > $LOG_TEMP 2>&1
expect_normal_exit $EX_PATH/btree $DIR/testfile1 i 4321 bar >> $LOG_TEMP 2>&1
expect_normal_exit $EX_PATH/btree $DIR/testfile1 i 1 Hello >> $LOG_TEMP 2>&1
expect_normal_exit $EX_PATH/btree $DIR/testfile1 i 2 World! >> $LOG_TEMP 2>&1
expect_normal_exit $EX_PATH/btree $DIR/testfile1 p >> $LOG_TEMP 2>&1
expect_normal_exit $EX_PATH/btree $DIR/testfile1 f 4321 >> $LOG_TEMP 2>&1

mv $LOG_TEMP $LOG

check

pass
