3 # Check various corner cases of upkg_decode_index.
4 # Copyright © 2012 Nick Bowler
6 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
7 # This is free software: you are free to do what the fuck you want to.
8 # There is NO WARRANTY, to the extent permitted by law.
10 decodeindex=test/decodeindex$EXEEXT
15 { $decodeindex "$1" 3>&-
16 echo decode_status=$? >&3
18 echo decode_val=$val >&3
24 (exit $decode_status) || return 1
25 if test x"$decode_val" != x"$2"; then
26 printf '%s: result (%d) does not match expected (%d)\n' \
27 "$scriptname" "$decode_val" "$2"
32 if (exit $decode_status); then
33 printf '%s: false positive on (%s), got (%d)\n' \
34 "$scriptname" "$1" "$decode_val"
45 test_index 4080808000 0
54 test_index 408080808000