File Coverage

UUID.xs
Criterion Covered Total %
statement 13 13 100.0
branch 16 28 57.1
condition n/a
subroutine n/a
pod n/a
total 29 41 70.7


line stmt bran cond sub pod time code
1             #include // uuid class
2             #include // generators
3             #include // streaming operators etc.
4             #include
5              
6             using namespace boost::uuids;
7              
8             MODULE = Boost::UUID PACKAGE = Boost::UUID
9             PROTOTYPES: DISABLE
10              
11             std::string random_uuid(){
12 1001 50         auto uuid = random_generator()();
13 1001 50         RETVAL = to_string(uuid);
    50          
14             }
15              
16             std::string nil_uuid(){
17 1001           auto uuid = nil_generator()();
18 1001 50         RETVAL = to_string(uuid);
    50          
19             }
20              
21             std::string string_uuid(std::string input_str ){
22 3 100         if ( input_str.empty() ) {
23 2 50         RETVAL = std::string();
    50          
24 1           return;
25             }
26              
27             string_generator gen;
28 2           auto u1 = nil_generator()();
29              
30             try {
31 2 100         u1 = gen(input_str);
32 1           }catch (const boost::exception& ex) {
33              
34             };
35              
36 2 50         RETVAL = to_string(u1);
    50          
37             }
38              
39             std::string name_uuid(std::string dns_name ){
40 2 50         auto uuid = name_generator(boost::uuids::uuid())(dns_name);
41 2 50         RETVAL = to_string(uuid);
    50          
42             }