#! /bin/sh

# See if test3_msg.h, contains the right stuff, assuming it was generated
# by a gencat of the "test3" message catalog.

cat <<EOF |
#define AnotherSet 0x2	/* test3.msg:13 */
#define AnotherFOO 0x1	/* test3.msg:14 */
EOF
cmp test3_msg.h -

if [ $? != 0 ]; then
  echo "Miscompare.  test3_msg.h contains the wrong stuff"
  exit 1
  fi

# Run test_catgets, which issues messages from the "test3" message
# catalog, which was presumably generated by gencat.

#export LOCPATH=./locale
#export GCONV_PATH=${common_objpfx}iconvdata
#export NLSPATH=
#export LC_ALL=test

./test_catgets ./test3.cat >test_catgets.out

# Compare with the expected result.

cmp - test_catgets.out <<"EOF"
sample1:ABCDEF:
sample2:{:
sample3:\\:
sample4:TEST	TAB:
sample5:@\	\:
double slash\
another line
EOF

if [ $? != 0 ]; then
  echo "Miscompare.  test_catgets issued wrong message text"
  exit 1
  fi

echo "all tests pass"

exit $res
