summaryrefslogtreecommitdiffstats
path: root/pceplib/test/pcep_msg_messages_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'pceplib/test/pcep_msg_messages_test.c')
-rw-r--r--pceplib/test/pcep_msg_messages_test.c50
1 files changed, 18 insertions, 32 deletions
diff --git a/pceplib/test/pcep_msg_messages_test.c b/pceplib/test/pcep_msg_messages_test.c
index c4eaeaa..e1f5249 100644
--- a/pceplib/test/pcep_msg_messages_test.c
+++ b/pceplib/test/pcep_msg_messages_test.c
@@ -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;
@@ -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 =
@@ -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);
@@ -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);
@@ -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;
@@ -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;
@@ -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);
@@ -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();
@@ -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();
@@ -398,10 +391,8 @@ void test_pcep_msg_create_update()
/* Should return NULL if obj_list is empty */
message = pcep_msg_create_update(obj_list);
CU_ASSERT_PTR_NULL(message);
- if (message != NULL) {
+ if (message != NULL)
pcep_msg_free_message(message);
- message = NULL;
- }
struct pcep_object_srp *srp = pcep_obj_create_srp(false, 100, NULL);
struct pcep_object_lsp *lsp =
@@ -417,10 +408,9 @@ void test_pcep_msg_create_update()
CU_ASSERT_PTR_NULL(message);
dll_append(obj_list, ero);
- if (message != NULL) {
+ if (message != NULL)
pcep_msg_free_message(message);
- message = NULL;
- }
+
message = pcep_msg_create_update(obj_list);
CU_ASSERT_PTR_NOT_NULL(message);
pcep_encode_message(message, versioning);
@@ -442,7 +432,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();
@@ -450,10 +440,8 @@ void test_pcep_msg_create_initiate()
/* Should return NULL if obj_list is empty */
struct pcep_message *message = pcep_msg_create_initiate(NULL);
CU_ASSERT_PTR_NULL(message);
- if (message != NULL) {
+ if (message != NULL)
pcep_msg_free_message(message);
- message = NULL;
- }
struct pcep_object_srp *srp = pcep_obj_create_srp(false, 100, NULL);
struct pcep_object_lsp *lsp =
@@ -466,10 +454,8 @@ void test_pcep_msg_create_initiate()
dll_append(obj_list, srp);
message = pcep_msg_create_initiate(obj_list);
CU_ASSERT_PTR_NULL(message);
- if (message != NULL) {
+ if (message != NULL)
pcep_msg_free_message(message);
- message = NULL;
- }
dll_append(obj_list, lsp);
dll_append(obj_list, ero);