Compare commits
4 commits
coverity_s
...
bleeding
Author | SHA1 | Date | |
---|---|---|---|
5b0f2b1290 | |||
![]() |
69a05ded6d | ||
![]() |
4e0ee1a319 | ||
![]() |
932b943cd2 |
5 changed files with 15 additions and 6 deletions
|
@ -39,6 +39,10 @@ identifier format.
|
|||
``Type`` is the compound type of the generated array. ``params`` and ``nb_params``
|
||||
are the pointer and the length of the generated array, respectively.
|
||||
|
||||
.. note::
|
||||
The parameter array must be reachable after the function returns -- as
|
||||
such, local arrays must be declared with `static` or dynamically allocated.
|
||||
|
||||
Passing multiple parameters
|
||||
---------------------------
|
||||
|
||||
|
@ -57,7 +61,7 @@ easily use a struct to hold the context as a workaround:
|
|||
};
|
||||
|
||||
ParameterizedTestParameters(suite_name, test_name) {
|
||||
struct my_params params[] = {
|
||||
static struct my_params params[] = {
|
||||
// parameter set
|
||||
};
|
||||
|
||||
|
@ -74,7 +78,7 @@ C++ users can also use a simpler syntax before returning an array of parameters:
|
|||
.. code-block:: c++
|
||||
|
||||
ParameterizedTestParameters(suite_name, test_name) {
|
||||
struct my_params params[] = {
|
||||
static struct my_params params[] = {
|
||||
// parameter set
|
||||
};
|
||||
|
||||
|
|
|
@ -17,4 +17,6 @@
|
|||
# define PACKAGE "${PROJECT_NAME}"
|
||||
# define VERSION "${PROJECT_VERSION}"
|
||||
|
||||
#define NN_SOCKET_PATH "/var/lib/"
|
||||
|
||||
#endif /* !CONFIG_H_IN_ */
|
||||
|
|
|
@ -323,8 +323,8 @@ static int criterion_run_all_tests_impl(struct criterion_test_set *set)
|
|||
_(msg_valgrind_jobs), CR_FG_BOLD, CR_RESET);
|
||||
}
|
||||
|
||||
char url[sizeof ("ipc://criterion_.sock") + 21];
|
||||
snprintf(url, sizeof (url), "ipc://criterion_%llu.sock", get_process_id());
|
||||
char url[sizeof ("ipc://" NN_SOCKET_PATH "criterion_.sock") + 21];
|
||||
snprintf(url, sizeof (url), "ipc://" NN_SOCKET_PATH "criterion_%llu.sock", get_process_id());
|
||||
|
||||
int sock = cri_proto_bind(url);
|
||||
if (sock < 0)
|
||||
|
|
|
@ -85,6 +85,7 @@ struct criterion_theory_context *cr_theory_init(void)
|
|||
void cr_theory_free(struct criterion_theory_context *ctx)
|
||||
{
|
||||
dcFree(ctx->vm);
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
static jmp_buf theory_jmp;
|
||||
|
|
|
@ -295,13 +295,15 @@ CR_API int criterion_handle_args(int argc, char *argv[],
|
|||
switch (c) {
|
||||
case 'b': criterion_options.logging_threshold = (enum criterion_logging_level) atou(DEF(optarg, "1")); break;
|
||||
case 'y': criterion_options.always_succeed = true; break;
|
||||
case 'z': fprintf(stderr, "--no-early-exit is now deprecated as it no longer does anything.\n");
|
||||
case 'z': fprintf(stderr, "--no-early-exit is now deprecated as it no longer does anything.\n"); break;
|
||||
case 'k': criterion_options.use_ascii = true; break;
|
||||
case 'j': criterion_options.jobs = atou(optarg); break;
|
||||
case 'f': criterion_options.fail_fast = true; break;
|
||||
case 'S': criterion_options.short_filename = true; break;
|
||||
|
||||
case 'p': fprintf(stderr, "--pattern has been renamed as --filter and is now deprecated.\n");
|
||||
case 'p':
|
||||
fprintf(stderr, "--pattern has been renamed as --filter and is now deprecated.\n");
|
||||
/* fallthrough */
|
||||
case 'F': criterion_options.pattern = optarg; break;
|
||||
case 'q': quiet = true; break;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue