projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix tests: NULL pointer dereference in ust channel unit tests
[lttng-tools.git]
/
tests
/
unit
/
test_ust_data.c
diff --git
a/tests/unit/test_ust_data.c
b/tests/unit/test_ust_data.c
index 61e2c3c6e54c558d650b7260120b1d6e8ab51eb4..b4e927c9d4ea8212284fee020ce6bc3f81acc8cd 100644
(file)
--- a/
tests/unit/test_ust_data.c
+++ b/
tests/unit/test_ust_data.c
@@
-60,9
+60,6
@@
static const char alphanum[] =
"abcdefghijklmnopqrstuvwxyz";
static char random_string[RANDOM_STRING_LEN];
"abcdefghijklmnopqrstuvwxyz";
static char random_string[RANDOM_STRING_LEN];
-static struct ltt_ust_session *usess;
-static struct lttng_domain dom;
-
/*
* Return random string of 10 characters.
* Not thread-safe.
/*
* Return random string of 10 characters.
* Not thread-safe.
@@
-82,9
+79,9
@@
static char *get_random_string(void)
static void test_create_one_ust_session(void)
{
static void test_create_one_ust_session(void)
{
- dom.type = LTTNG_DOMAIN_UST;
+ struct ltt_ust_session *usess =
+ trace_ust_create_session(42);
- usess = trace_ust_create_session(42);
ok(usess != NULL, "Create UST session");
if (!usess) {
ok(usess != NULL, "Create UST session");
if (!usess) {
@@
-117,8
+114,8
@@
static void test_create_ust_channel(void)
uchan = trace_ust_create_channel(&attr, LTTNG_DOMAIN_UST);
ok(uchan != NULL, "Create UST channel");
uchan = trace_ust_create_channel(&attr, LTTNG_DOMAIN_UST);
ok(uchan != NULL, "Create UST channel");
- if (!u
sess
) {
- skip(1, "UST
session
is null");
+ if (!u
chan
) {
+ skip(1, "UST
channel
is null");
return;
}
return;
}
This page took
0.0267 seconds
and
4
git commands to generate.