Skip to content

Commit

Permalink
pceplib: Fix code not building properly
Browse files Browse the repository at this point in the history
The series of pceplib tests are not being run at the moment
due to them not even building.  Apparently adding the `libcunit1`
debian package is enough to get them to build in our system.
While weird, let's get this building at least for people that
have this and `--enable-werror` turned on.

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Jan 24, 2024
1 parent e3e4232 commit b28eaa1
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 116 deletions.
2 changes: 1 addition & 1 deletion pceplib/pcep_socket_comm_mock.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ bool initialize_socket_comm_external_infra(
return true;
}

bool destroy_socket_comm_loop()
bool destroy_socket_comm_loop(void)
{
mock_socket_metadata.destroy_socket_comm_loop_times_called++;

Expand Down
33 changes: 13 additions & 20 deletions pceplib/test/pcep_msg_messages_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ int pcep_messages_test_suite_teardown(void)
return 0;
}

void pcep_messages_test_setup()
void pcep_messages_test_setup(void)
{
versioning = create_default_pcep_versioning();
}

void pcep_messages_test_teardown()
void pcep_messages_test_teardown(void)
{
destroy_pcep_versioning(versioning);
}

void test_pcep_msg_create_open()
void test_pcep_msg_create_open(void)
{
uint8_t keepalive = 30;
uint8_t deadtimer = 60;
Expand Down Expand Up @@ -96,8 +96,7 @@ void test_pcep_msg_create_open()
pcep_msg_free_message(message);
}


void test_pcep_msg_create_request()
void test_pcep_msg_create_request(void)
{
/* First test with NULL objects */
struct pcep_message *message =
Expand Down Expand Up @@ -185,13 +184,11 @@ void test_pcep_msg_create_request()
pcep_msg_free_message(message);
}


void test_pcep_msg_create_request_svec()
void test_pcep_msg_create_request_svec(void)
{
}


void test_pcep_msg_create_reply_nopath()
void test_pcep_msg_create_reply_nopath(void)
{
struct pcep_object_rp *rp_obj =
pcep_obj_create_rp(0, false, false, false, false, 10, NULL);
Expand Down Expand Up @@ -219,8 +216,7 @@ void test_pcep_msg_create_reply_nopath()
pcep_msg_free_message(message);
}


void test_pcep_msg_create_reply()
void test_pcep_msg_create_reply(void)
{
/* First test with NULL ero and rp objects */
struct pcep_message *message = pcep_msg_create_reply(NULL, NULL);
Expand Down Expand Up @@ -268,8 +264,7 @@ void test_pcep_msg_create_reply()
pcep_msg_free_message(message);
}


void test_pcep_msg_create_close()
void test_pcep_msg_create_close(void)
{
uint8_t reason = PCEP_CLOSE_REASON_UNREC_MSG;

Expand Down Expand Up @@ -301,8 +296,7 @@ void test_pcep_msg_create_close()
pcep_msg_free_message(message);
}


void test_pcep_msg_create_error()
void test_pcep_msg_create_error(void)
{
uint8_t error_type = PCEP_ERRT_RECEPTION_OF_INV_OBJECT;
uint8_t error_value = PCEP_ERRV_KEEPALIVEWAIT_TIMED_OUT;
Expand Down Expand Up @@ -337,8 +331,7 @@ void test_pcep_msg_create_error()
pcep_msg_free_message(message);
}


void test_pcep_msg_create_keepalive()
void test_pcep_msg_create_keepalive(void)
{
struct pcep_message *message = pcep_msg_create_keepalive();
CU_ASSERT_PTR_NOT_NULL(message);
Expand All @@ -356,7 +349,7 @@ void test_pcep_msg_create_keepalive()
pcep_msg_free_message(message);
}

void test_pcep_msg_create_report()
void test_pcep_msg_create_report(void)
{
double_linked_list *obj_list = dll_initialize();

Expand Down Expand Up @@ -387,7 +380,7 @@ void test_pcep_msg_create_report()
pcep_msg_free_message(message);
}

void test_pcep_msg_create_update()
void test_pcep_msg_create_update(void)
{
double_linked_list *obj_list = dll_initialize();
double_linked_list *ero_subobj_list = dll_initialize();
Expand Down Expand Up @@ -442,7 +435,7 @@ void test_pcep_msg_create_update()
pcep_msg_free_message(message);
}

void test_pcep_msg_create_initiate()
void test_pcep_msg_create_initiate(void)
{
double_linked_list *obj_list = dll_initialize();
double_linked_list *ero_subobj_list = dll_initialize();
Expand Down
4 changes: 2 additions & 2 deletions pceplib/test/pcep_msg_object_error_types_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void pcep_object_error_types_test_teardown(void)
{
}

void test_get_error_type_str()
void test_get_error_type_str(void)
{
const char *error_type_str;
int i = 0;
Expand All @@ -57,7 +57,7 @@ void test_get_error_type_str()
CU_ASSERT_PTR_NULL(get_error_type_str(MAX_ERROR_TYPE));
}

void test_get_error_value_str()
void test_get_error_value_str(void)
{
const char *error_value_str;
int i = 0, j = 0;
Expand Down
Loading

0 comments on commit b28eaa1

Please sign in to comment.