|
From: <mat...@us...> - 2014-04-07 02:30:35
|
Revision: 542
http://sourceforge.net/p/cgreen/code/542
Author: matt_hargett
Date: 2014-04-07 02:30:25 +0000 (Mon, 07 Apr 2014)
Log Message:
-----------
apply a modified version of patch #26 from the sourceforge tracker. thanks to Ethan Barnes!
Modified Paths:
--------------
trunk/cgreen/include/cgreen/internal/suite_internal.h
trunk/cgreen/include/cgreen/internal/unit_implementation.h
trunk/cgreen/include/cgreen/suite.h
trunk/cgreen/src/messaging.c
trunk/cgreen/src/mocks.c
trunk/cgreen/src/posix_runner_platform.c
Modified: trunk/cgreen/include/cgreen/internal/suite_internal.h
===================================================================
--- trunk/cgreen/include/cgreen/internal/suite_internal.h 2014-04-06 22:19:30 UTC (rev 541)
+++ trunk/cgreen/include/cgreen/internal/suite_internal.h 2014-04-07 02:30:25 UTC (rev 542)
@@ -27,8 +27,8 @@
const char* filename;
int line;
UnitTest *tests;
- void (*setup)();
- void (*teardown)();
+ void (*setup)(void);
+ void (*teardown)(void);
int size;
};
Modified: trunk/cgreen/include/cgreen/internal/unit_implementation.h
===================================================================
--- trunk/cgreen/include/cgreen/internal/unit_implementation.h 2014-04-06 22:19:30 UTC (rev 541)
+++ trunk/cgreen/include/cgreen/internal/unit_implementation.h 2014-04-07 02:30:25 UTC (rev 542)
@@ -38,14 +38,14 @@
#define EnsureWithContextAndSpecificationName(contextName, spec, ...) \
static void contextName##__##spec (void);\
CgreenTest spec_name(contextName, spec) = { &contextFor##contextName, #spec, &contextName##__##spec, __FILE__, __LINE__ };\
- static void contextName##__##spec ()
+ static void contextName##__##spec (void)
extern CgreenContext defaultContext;
#define EnsureWithSpecificationName(spec, ...) \
static void spec (void);\
CgreenTest spec_name(default, spec) = { &defaultContext, #spec, &spec, __FILE__, __LINE__ };\
- static void spec ()
+ static void spec (void)
#define DescribeImplementation(subject) \
static void setup(void); \
Modified: trunk/cgreen/include/cgreen/suite.h
===================================================================
--- trunk/cgreen/include/cgreen/suite.h 2014-04-06 22:19:30 UTC (rev 541)
+++ trunk/cgreen/include/cgreen/suite.h 2014-04-07 02:30:25 UTC (rev 542)
@@ -23,8 +23,8 @@
#define add_tests(suite, ...) add_tests_(suite, #__VA_ARGS__, (CgreenTest *)__VA_ARGS__)
#define add_suite(owner, suite) add_suite_(owner, #suite, suite)
-void set_setup(TestSuite *suite, void (*set_up)());
-void set_teardown(TestSuite *suite, void (*tear_down)());
+void set_setup(TestSuite *suite, void (*set_up)(void));
+void set_teardown(TestSuite *suite, void (*tear_down)(void));
int count_tests(TestSuite *suite);
bool has_test(TestSuite *suite, const char *name);
bool has_setup(TestSuite *suite);
Modified: trunk/cgreen/src/messaging.c
===================================================================
--- trunk/cgreen/src/messaging.c 2014-04-06 22:19:30 UTC (rev 541)
+++ trunk/cgreen/src/messaging.c 2014-04-07 02:30:25 UTC (rev 542)
@@ -36,7 +36,7 @@
static CgreenMessageQueue *queues = NULL;
static int queue_count = 0;
-int get_pipe_read_handle()
+int get_pipe_read_handle(void)
{
if (queue_count)
{
@@ -46,7 +46,7 @@
return 0;
}
-int get_pipe_write_handle()
+int get_pipe_write_handle(void)
{
if (queue_count)
{
@@ -127,7 +127,7 @@
return result;
}
-static void clean_up_messaging() {
+static void clean_up_messaging(void) {
int i;
for (i = 0; i < queue_count; i++) {
if (queues[i].owner == getpid()) {
Modified: trunk/cgreen/src/mocks.c
===================================================================
--- trunk/cgreen/src/mocks.c 2014-04-06 22:19:30 UTC (rev 541)
+++ trunk/cgreen/src/mocks.c 2014-04-07 02:30:25 UTC (rev 542)
@@ -415,7 +415,7 @@
expectation->function);
}
-void clear_mocks() {
+void clear_mocks(void) {
if (global_expectation_queue != NULL) {
destroy_cgreen_vector(global_expectation_queue);
global_expectation_queue = NULL;
@@ -505,21 +505,21 @@
free(expectation);
}
-static void ensure_successfully_mocked_calls_list_exists() {
+static void ensure_successfully_mocked_calls_list_exists(void) {
if (successfully_mocked_calls == NULL) {
// successfully_mocked_calls are __func__, so there's nothing to destroy
successfully_mocked_calls = create_cgreen_vector(NULL);
}
}
-static void ensure_learned_mock_calls_list_exists() {
+static void ensure_learned_mock_calls_list_exists(void) {
if (learned_mock_calls == NULL) {
// learned_mock_calls are __func__, so there's nothing to destroy
learned_mock_calls = create_cgreen_vector(NULL);
}
}
-static void ensure_expectation_queue_exists() {
+static void ensure_expectation_queue_exists(void) {
if (global_expectation_queue == NULL) {
global_expectation_queue = create_cgreen_vector((GenericDestructor)&destroy_expectation);
}
Modified: trunk/cgreen/src/posix_runner_platform.c
===================================================================
--- trunk/cgreen/src/posix_runner_platform.c 2014-04-06 22:19:30 UTC (rev 541)
+++ trunk/cgreen/src/posix_runner_platform.c 2014-04-07 02:30:25 UTC (rev 542)
@@ -17,9 +17,9 @@
typedef void (*sighandler_t)(int);
-static int in_child_process();
-static int wait_for_child_process();
-static void stop();
+static int in_child_process(void);
+static int wait_for_child_process(void);
+static void stop(void);
static void ignore_ctrl_c(void);
static void allow_ctrl_c(void);
@@ -37,7 +37,7 @@
const int sig = WTERMSIG(status);
if (sig != SIGABRT) {
char buf[128];
- snprintf(buf, sizeof(buf), "Test terminated with signal: %s", strsignal(sig));
+ snprintf(buf, sizeof(buf), "Test terminated with signal: %s", (const char *)strsignal(sig));
(*reporter->finish_test)(reporter, test->filename, test->line, buf);
return;
}
@@ -46,7 +46,7 @@
}
}
-static int in_child_process() {
+static int in_child_process(void) {
fflush(NULL); /* Flush all buffers before forking */
pid_t child = fork();
if (child < 0) {
@@ -55,7 +55,7 @@
return ! child;
}
-static int wait_for_child_process() {
+static int wait_for_child_process(void) {
int status = 0;
ignore_ctrl_c();
wait(&status);
@@ -79,15 +79,15 @@
(void)reporter;
}
-static void stop() {
+static void stop(void) {
_exit(EXIT_SUCCESS);
}
-static void ignore_ctrl_c() {
+static void ignore_ctrl_c(void) {
signal(SIGINT, SIG_IGN);
}
-static void allow_ctrl_c() {
+static void allow_ctrl_c(void) {
signal(SIGINT, SIG_DFL);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|