[Issue #64] Prefixed all unprefixed API functions and types

This commit is contained in:
Snaipe 2015-10-02 15:10:41 +02:00
parent c3fdc08b02
commit 4148d3d5d4
13 changed files with 21 additions and 21 deletions

View file

@ -72,7 +72,7 @@ enum criterion_assert_messages {
CR_BEGIN_C_API
CR_API char *translate_assert_msg(int msg_index, ...);
CR_API char *cr_translate_assert_msg(int msg_index, ...);
CR_END_C_API
@ -90,7 +90,7 @@ CR_END_C_API
CR_IDENTITY Arg
# define CR_TRANSLATE_DEF_MSG_(...) \
CR_EXPAND(translate_assert_msg( \
CR_EXPAND(cr_translate_assert_msg( \
CR_VA_HEAD(__VA_ARGS__), \
"" CR_TRANSLATE_DEF_MSG__(CR_VA_HEAD(CR_VA_TAIL(__VA_ARGS__))) \
))
@ -145,7 +145,7 @@ CR_END_C_API
stat->file = __FILE__; \
stat->line = __LINE__; \
\
send_event(ASSERT, stat, bufsize); \
criterion_send_event(ASSERT, stat, bufsize); \
CR_STDN free(stat); \
\
if (!passed) \

View file

@ -33,7 +33,7 @@
CR_BEGIN_C_API
CR_API void send_event(int kind, void *data, size_t size);
CR_API void criterion_send_event(int kind, void *data, size_t size);
CR_END_C_API

View file

@ -129,6 +129,6 @@ struct criterion_test_set {
size_t tests;
};
typedef void (*f_worker_func)(struct criterion_test *, struct criterion_suite *);
typedef void (*cr_worker_func)(struct criterion_test *, struct criterion_suite *);
#endif /* !CRITERION_TYPES_H_ */

View file

@ -98,7 +98,7 @@ struct full_context {
struct criterion_test_extra_data test_data;
struct criterion_suite suite;
struct criterion_test_extra_data suite_data;
f_worker_func func;
cr_worker_func func;
struct pipe_handle pipe;
struct test_single_param param;
HANDLE sync;

View file

@ -40,7 +40,7 @@ typedef struct proc_handle s_proc_handle;
struct worker_context {
struct criterion_test *test;
struct criterion_suite *suite;
f_worker_func func;
cr_worker_func func;
struct pipe_handle *pipe;
struct test_single_param *param;
};

View file

@ -46,7 +46,7 @@ void criterion_test_die(const char *msg, ...) {
*buf = res + 1;
memcpy(buf + 1, formatted_msg, res + 1);
send_event(TEST_ABORT, buf, sizeof (size_t) + res + 1);
criterion_send_event(TEST_ABORT, buf, sizeof(size_t) + res + 1);
free(buf);
free(formatted_msg);

View file

@ -222,7 +222,7 @@ void cr_theory_main(struct criterion_datapoints *dps, size_t datapoints, void (*
concat_arg(&result.msg, dps, indices, datapoints - 1);
result.len = strlen(result.msg) + 1;
send_event(THEORY_FAIL, &result, result.len + sizeof (size_t));
criterion_send_event(THEORY_FAIL, &result, result.len + sizeof(size_t));
}
}

View file

@ -91,7 +91,7 @@ void run_worker(struct worker_context *ctx) {
}
struct worker *spawn_test_worker(struct execution_context *ctx,
f_worker_func func,
cr_worker_func func,
s_pipe_handle *pipe) {
g_worker_context = (struct worker_context) {
.test = ctx->test,

View file

@ -84,7 +84,7 @@ bool is_runner(void);
struct process_status wait_proc(struct worker *proc);
struct process_status get_status(int status);
struct worker *spawn_test_worker(struct execution_context *ctx,
f_worker_func func,
cr_worker_func func,
s_pipe_handle *pipe);
struct event *worker_read_event(struct worker_set *workers, s_pipe_file_handle *pipe);

View file

@ -33,11 +33,11 @@ static INLINE void nothing(void) {}
void c_wrap(struct criterion_test *test, struct criterion_suite *suite) {
send_event(PRE_INIT, NULL, 0);
criterion_send_event(PRE_INIT, NULL, 0);
if (suite->data)
(suite->data->init ? suite->data->init : nothing)();
(test->data->init ? test->data->init : nothing)();
send_event(PRE_TEST, NULL, 0);
criterion_send_event(PRE_TEST, NULL, 0);
struct timespec_compat ts;
if (!setjmp(g_pre_test)) {
@ -56,10 +56,10 @@ void c_wrap(struct criterion_test *test, struct criterion_suite *suite) {
if (!timer_end(&elapsed_time, &ts))
elapsed_time = -1;
send_event(POST_TEST, &elapsed_time, sizeof (double));
criterion_send_event(POST_TEST, &elapsed_time, sizeof(double));
(test->data->fini ? test->data->fini : nothing)();
if (suite->data)
(suite->data->fini ? suite->data->fini : nothing)();
send_event(POST_FINI, NULL, 0);
criterion_send_event(POST_FINI, NULL, 0);
}

View file

@ -38,7 +38,7 @@ static INLINE void nothing(void) {}
void cpp_wrap(struct criterion_test *test, struct criterion_suite *suite) {
send_event(PRE_INIT, NULL, 0);
criterion_send_event(PRE_INIT, NULL, 0);
try {
if (suite->data)
(suite->data->init ? suite->data->init : nothing)();
@ -48,7 +48,7 @@ void cpp_wrap(struct criterion_test *test, struct criterion_suite *suite) {
} catch (...) {
criterion_test_die("Caught some unexpected exception during the test initialization.");
}
send_event(PRE_TEST, NULL, 0);
criterion_send_event(PRE_TEST, NULL, 0);
struct timespec_compat ts;
if (!setjmp(g_pre_test)) {
@ -73,7 +73,7 @@ void cpp_wrap(struct criterion_test *test, struct criterion_suite *suite) {
if (!timer_end(&elapsed_time, &ts))
elapsed_time = -1;
send_event(POST_TEST, &elapsed_time, sizeof (double));
criterion_send_event(POST_TEST, &elapsed_time, sizeof(double));
try {
(test->data->fini ? test->data->fini : nothing)();
if (suite->data)
@ -83,7 +83,7 @@ void cpp_wrap(struct criterion_test *test, struct criterion_suite *suite) {
} catch (...) {
criterion_test_die("Caught some unexpected exception during the test finalization.");
}
send_event(POST_FINI, NULL, 0);
criterion_send_event(POST_FINI, NULL, 0);
}

View file

@ -150,7 +150,7 @@ struct event *read_event(s_pipe_file_handle *f) {
}
}
void send_event(int kind, void *data, size_t size) {
void criterion_send_event(int kind, void *data, size_t size) {
unsigned long long pid = get_process_id();
unsigned char *buf = malloc(sizeof (int) + sizeof (pid) + size);

View file

@ -8,7 +8,7 @@ void init_i18n(void) {
#endif
}
char *translate_assert_msg(int msg_index, ...) {
char *cr_translate_assert_msg(int msg_index, ...) {
static char *messages[] = {
[CRITERION_ASSERT_MSG_FAIL] = N_("The conditions for this assertion were not met."),
[CRITERION_ASSERT_MSG_EXPR_FALSE] = N_("The expression %s is false."),