1 AT_BANNER([UUID unit tests])
3 m4_define([UUID_REGEX],
4 [[[0-9a-f]\{8\}-[0-9a-f]\{4\}-4[0-9a-f]\{3\}-[89ab][0-9a-f]\{3\}-[0-9a-f]\{12\}$]])
6 m4_define([CHECK_UUID],
7 [if expr "$uuid" : 'UUID_REGEX' > /dev/null
11 echo "$uuid: not a random UUID"
15 AT_SETUP([UUID generation, parsing, serialization])
19 for i in m4_for([count], [1], [100], [1], [count ]); do
20 # Generate random UUID and check that it is in the expected format.
24 # Verify that $uuid does not duplicate any UUID generated so far.
27 echo "$uuid: generated duplicate UUID"
32 # Verify that test-uuid parses and re-serializes this UUID correctly.
33 serialized=`test-uuid $uuid`
34 if test "$uuid" != "$serialized"; then
35 echo "$uuid: test-uuid serialized this as $serialized"