line=`$cmd_prefix $format`
[[ "$line" == "rawformatTEST" ]] && ok || fail
+if [ $type == "pipe" ]; then
+ for format in raw brief long; do
+ for i in {1..8} 10 15 20 25; do
+ LOG_DETAILS="testing if padding works correctly (format $format/count $i)"
+ log=$(printf '%0.s&' $(seq 1 $i)) # Print the '&' character $i times
+
+ dlogutil -c
+ dlogsend -b main $log
+ line=$($cmd_prefix $format | tr '\n' '@')
+
+ case $format in
+ raw)
+ REGEX="s/$log@/1/g"
+ ;;
+ brief)
+ REGEX="s/I\/DLOG_SEND\([0-9[:space:]]{5,}\):\s{1}$log@$/1/g"
+ ;;
+ long)
+ REGEX="s/\[\s{1}$regex_time.[0-9]{3,}\s{1}I\/DLOG_SEND\s{1}$regex_pidtid\]@$log@@/1/g"
+ ;;
+ esac
+
+ [[ $(echo "$line" | sed -re $REGEX) == "1" ]] && ok || fail
+ done
+ done
+fi
+
LOG_DETAILS="testing if KMSG works in the default format"
# We check if the command returns at least 100 logs. This seems to be a safe value.
# Feel free to change it to a reasonable yet lower value if the test happens to fail otherwise.