projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
liblttng-ctl: use lttng_payload for serialize/create_from_buffer
[lttng-tools.git]
/
tests
/
utils
/
tap
/
tap.c
diff --git
a/tests/utils/tap/tap.c
b/tests/utils/tap/tap.c
index a430951193328aca551e34dfa1f3622a9b23ef28..7395f6fc59b80c14ce5a710ff8018e45d025f861 100644
(file)
--- a/
tests/utils/tap/tap.c
+++ b/
tests/utils/tap/tap.c
@@
-1,7
+1,9
@@
/*-
/*-
- * Copyright (
c
) 2004 Nik Clayton
+ * Copyright (
C
) 2004 Nik Clayton
* All rights reserved.
*
* All rights reserved.
*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@
-24,7
+26,6
@@
* SUCH DAMAGE.
*/
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
@@
-39,7
+40,7
@@
static unsigned int test_count = 0; /* Number of tests that have been run */
static unsigned int e_tests = 0; /* Expected number of tests to run */
static unsigned int failures = 0; /* Number of tests that failed */
static char *todo_msg = NULL;
static unsigned int e_tests = 0; /* Expected number of tests to run */
static unsigned int failures = 0; /* Number of tests that failed */
static char *todo_msg = NULL;
-static char *todo_msg_fixed = "libtap malloc issue";
+static c
onst c
har *todo_msg_fixed = "libtap malloc issue";
static int todo = 0;
static int test_died = 0;
static int todo = 0;
static int test_died = 0;
@@
-67,8
+68,8
@@
static void _cleanup(void);
* test_comment -- a comment to print afterwards, may be NULL
*/
unsigned int
* test_comment -- a comment to print afterwards, may be NULL
*/
unsigned int
-_gen_result(int ok, const char *func, char *file, unsigned int line,
- char *test_name, ...)
+_gen_result(int ok, const char *func, c
onst c
har *file, unsigned int line,
+ c
onst c
har *test_name, ...)
{
va_list ap;
char *local_test_name = NULL;
{
va_list ap;
char *local_test_name = NULL;
@@
-83,7
+84,9
@@
_gen_result(int ok, const char *func, char *file, unsigned int line,
expansions on it */
if(test_name != NULL) {
va_start(ap, test_name);
expansions on it */
if(test_name != NULL) {
va_start(ap, test_name);
- vasprintf(&local_test_name, test_name, ap);
+ if (vasprintf(&local_test_name, test_name, ap) == -1) {
+ local_test_name = NULL;
+ }
va_end(ap);
/* Make sure the test name contains more than digits
va_end(ap);
/* Make sure the test name contains more than digits
@@
-267,7
+270,7
@@
plan_tests(unsigned int tests)
}
unsigned int
}
unsigned int
-diag(char *fmt, ...)
+diag(c
onst c
har *fmt, ...)
{
va_list ap;
{
va_list ap;
@@
-291,15
+294,17
@@
_expected_tests(unsigned int tests)
}
int
}
int
-skip(unsigned int n, char *fmt, ...)
+skip(unsigned int n, c
onst c
har *fmt, ...)
{
va_list ap;
{
va_list ap;
- char *skip_msg;
+ char *skip_msg
= NULL
;
LOCK;
va_start(ap, fmt);
LOCK;
va_start(ap, fmt);
- asprintf(&skip_msg, fmt, ap);
+ if (asprintf(&skip_msg, fmt, ap) == -1) {
+ skip_msg = NULL;
+ }
va_end(ap);
while(n-- > 0) {
va_end(ap);
while(n-- > 0) {
@@
-324,7
+329,9
@@
todo_start(char *fmt, ...)
LOCK;
va_start(ap, fmt);
LOCK;
va_start(ap, fmt);
- vasprintf(&todo_msg, fmt, ap);
+ if (vasprintf(&todo_msg, fmt, ap) == -1) {
+ todo_msg = NULL;
+ }
va_end(ap);
todo = 1;
va_end(ap);
todo = 1;
This page took
0.031431 seconds
and
5
git commands to generate.