about summary refs log tree commit diff stats
path: root/tests/unittests/test_callbacks.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-07-07 09:43:28 +0200
committerMichael Vetter <jubalh@iodoru.org>2020-07-07 09:43:28 +0200
commit9b55f2dec0ea27a9ce4856e303425e12f866cea2 (patch)
tree87b723739c420cb7bb4ca7db20dc1d7fc2b3de05 /tests/unittests/test_callbacks.c
parent66f9a6b7219391b2c8bee5967f5ef7e223fd5d23 (diff)
downloadprofani-tty-9b55f2dec0ea27a9ce4856e303425e12f866cea2.tar.gz
Apply coding style
Regards https://github.com/profanity-im/profanity/issues/1396
Diffstat (limited to 'tests/unittests/test_callbacks.c')
-rw-r--r--tests/unittests/test_callbacks.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/unittests/test_callbacks.c b/tests/unittests/test_callbacks.c
index ec411863..4f4f9f91 100644
--- a/tests/unittests/test_callbacks.c
+++ b/tests/unittests/test_callbacks.c
@@ -1,18 +1,19 @@
+#include <cmocka.h>
+#include <glib.h>
+#include <setjmp.h>
 #include <stdarg.h>
 #include <stddef.h>
-#include <setjmp.h>
-#include <cmocka.h>
 #include <stdlib.h>
 #include <string.h>
-#include <glib.h>
 
 #include "plugins/callbacks.h"
 #include "plugins/plugins.h"
 
-void returns_no_commands(void **state)
+void
+returns_no_commands(void** state)
 {
     callbacks_init();
-    GList *commands = plugins_get_command_names();
+    GList* commands = plugins_get_command_names();
 
     assert_true(commands == NULL);
 
@@ -20,29 +21,30 @@ void returns_no_commands(void **state)
     g_list_free(commands);
 }
 
-void returns_commands(void **state)
+void
+returns_commands(void** state)
 {
     callbacks_init();
 
-    PluginCommand *command1 = malloc(sizeof(PluginCommand));
+    PluginCommand* command1 = malloc(sizeof(PluginCommand));
     command1->command_name = strdup("command1");
     callbacks_add_command("plugin1", command1);
 
-    PluginCommand *command2 = malloc(sizeof(PluginCommand));
+    PluginCommand* command2 = malloc(sizeof(PluginCommand));
     command2->command_name = strdup("command2");
     callbacks_add_command("plugin1", command2);
 
-    PluginCommand *command3 = malloc(sizeof(PluginCommand));
+    PluginCommand* command3 = malloc(sizeof(PluginCommand));
     command3->command_name = strdup("command3");
     callbacks_add_command("plugin2", command3);
 
-    GList *names = plugins_get_command_names();
+    GList* names = plugins_get_command_names();
     assert_true(g_list_length(names) == 3);
 
     gboolean foundCommand1 = FALSE;
     gboolean foundCommand2 = FALSE;
     gboolean foundCommand3 = FALSE;
-    GList *curr = names;
+    GList* curr = names;
     while (curr) {
         if (g_strcmp0(curr->data, "command1") == 0) {
             foundCommand1 = TRUE;