Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuild-aux/list2typedef2
-rwxr-xr-xbuild-aux/test/test-list2typedef12
2 files changed, 7 insertions, 7 deletions
diff --git a/build-aux/list2typedef b/build-aux/list2typedef
index fdb5c59..3a18cf3 100755
--- a/build-aux/list2typedef
+++ b/build-aux/list2typedef
@@ -66,7 +66,7 @@ output-item()
local name; read -r name
local -r const=$( constify "$typedef" <<< "$name" )
- local -r value=$( hash-name "$bytes" <<< "$name" )
+ local -r value=$( echo -n "$name" | hash-name "$bytes" )
assert-collision "$const" "$value"
diff --git a/build-aux/test/test-list2typedef b/build-aux/test/test-list2typedef
index e417c02..62a5bd8 100755
--- a/build-aux/test/test-list2typedef
+++ b/build-aux/test/test-list2typedef
@@ -41,9 +41,9 @@ Second'\''s @ @Line
title="FooType Type">
<typedef name="FooType" desc="FooType">
<enum type="integer">
- <item name="FOOTYPE_FIRST" value="4285081399" desc="First" />
- <item name="FOOTYPE_SECONDS_LINE" value="582715539" desc="Second'\''s @ @Line" />
- <item name="FOOTYPE_THIRD" value="3355510722" desc="!!!THIRD!!!" />
+ <item name="FOOTYPE_FIRST" value="2706493105" desc="First" />
+ <item name="FOOTYPE_SECONDS_LINE" value="3512333918" desc="Second'\''s @ @Line" />
+ <item name="FOOTYPE_THIRD" value="519392729" desc="!!!THIRD!!!" />
</enum>
</typedef>
</package>'
@@ -79,11 +79,11 @@ test-collision-value-check()
# we can easily force a collision by reducing the number of bytes to 1 and
# calculating hashes from /usr/share/dict/words; this is one example
- local err=$( ../list2typedef Foo 1 2>&1 >/dev/null <<< 'abacist
-abatis
+ local err=$( ../list2typedef Foo 1 2>&1 >/dev/null <<< 'abase
+abate
' && echo 'EXPECTED FAILURE' )
- [[ "$err" =~ ABATIS && "$err" =~ '44' ]] || {
+ [[ "$err" =~ ABATE && "$err" =~ '157' ]] || {
echo 'expecting useful error message for value collion' >&2
return 1
}