Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
Icecast libigloo
Commits
cba77dbc
Commit
cba77dbc
authored
Feb 26, 2022
by
Philipp Schafft
🦁
Browse files
Feature: Improved UUID testing
parent
4f733cba
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/uuid.c
View file @
cba77dbc
...
...
@@ -30,6 +30,19 @@
static
igloo_ro_t
g_instance
;
static
void
check_uuid
(
const
char
*
ref
)
{
size_t
len
=
strlen
(
ref
);
igloo_tap_test
(
"strlen(ref) == 36"
,
len
==
36
);
igloo_tap_diagnostic
(
"Ref is:"
);
igloo_tap_diagnostic
(
ref
);
if
(
len
==
36
)
{
igloo_tap_test
(
"ref[8] == '-' && ref[13] == '-' && ref[18] == '-' && ref[23] == '-'"
,
ref
[
8
]
==
'-'
&&
ref
[
13
]
==
'-'
&&
ref
[
18
]
==
'-'
&&
ref
[
23
]
==
'-'
);
}
}
static
void
group_sp
(
void
)
{
const
char
*
ref
=
NULL
;
...
...
@@ -37,7 +50,7 @@ static void group_sp(void)
igloo_tap_test_success
(
"igloo_uuid_new_random_sp"
,
igloo_uuid_new_random_sp
(
&
ref
,
g_instance
));
igloo_tap_test
(
"ref != NULL"
,
ref
!=
NULL
);
if
(
ref
)
{
igloo_tap_test
(
"strlen(ref) == 36"
,
strlen
(
ref
)
==
36
);
check_uuid
(
ref
);
igloo_tap_test_success
(
"igloo_sp_unref"
,
igloo_sp_unref
(
&
ref
,
g_instance
));
igloo_tap_test
(
"ref == NULL"
,
ref
==
NULL
);
}
...
...
@@ -50,7 +63,7 @@ static void group_cstr(void)
igloo_tap_test_success
(
"igloo_uuid_new_random_cstr"
,
igloo_uuid_new_random_cstr
(
&
ref
,
g_instance
));
igloo_tap_test
(
"ref != NULL"
,
ref
!=
NULL
);
if
(
ref
)
{
igloo_tap_test
(
"strlen(ref) == 36"
,
strlen
(
ref
)
==
36
);
check_uuid
(
ref
);
free
(
ref
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment