File: 9compare_close.t

package info (click to toggle)
libuuid-perl 0.37-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,092 kB
  • sloc: ansic: 2,374; perl: 580; makefile: 5
file content (25 lines) | stat: -rw-r--r-- 416 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use warnings;
use Test::More tests => 52;
use UUID 'uuid';


# core dumps seemed to be triggered mainly when
# two calls to compare() were very close together.

my ($bin1, $bin2);

UUID::generate($bin1);
ok 1, 'gen1';

UUID::generate_random($bin2);
ok 1, 'gen2';

for my $n ( 1 .. 50 ) {
    my @foo = (
        UUID::compare($bin1,$bin2),
        UUID::compare($bin1,$bin2),
    );
    ok 1, "close $n";
}

exit 0;