mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 08:17:40 -04:00
Some of our testcases check fdtget retreiving string list properties that include internal \0 characters. We use printf(1) to generate the expected value for comparison. However, on FreeBSD, printf(1)'s %b format option can't handle \0: it will terminate that argument ignoring it and everything after. Curiously, internal \0 *is* ok in the main format string. So avoid using %b and use the format string directly instead. Link: https:/https://github.com/dgibson/dtc/issues/165 Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
25 lines
412 B
Bash
Executable file
25 lines
412 B
Bash
Executable file
#! /bin/sh
|
|
|
|
SRCDIR=`dirname "$0"`
|
|
. "$SRCDIR/testutils.sh"
|
|
|
|
LOG=tmp.log.$$
|
|
EXPECT=tmp.expect.$$
|
|
rm -f $LOG $EXPECT
|
|
trap "rm -f $LOG $EXPECT" 0
|
|
|
|
expect="$1"
|
|
printf "$expect\n" > $EXPECT
|
|
shift
|
|
|
|
verbose_run_log_check "$LOG" $VALGRIND $DTGET "$@"
|
|
|
|
if cmp $EXPECT $LOG>/dev/null; then
|
|
PASS
|
|
else
|
|
if [ -z "$QUIET_TEST" ]; then
|
|
echo "EXPECTED :-:"
|
|
cat $EXPECT
|
|
fi
|
|
FAIL "Results differ from expected"
|
|
fi
|