tests: exclude arg parsing 07/218807/6
authorMichal Bloch <m.bloch@samsung.com>
Mon, 27 Jan 2020 16:56:29 +0000 (17:56 +0100)
committerMichal Bloch <m.bloch@samsung.com>
Tue, 28 Jan 2020 14:17:35 +0000 (15:17 +0100)
Belongs to integration tests

Change-Id: I1c26dddd73dbc0434479aa9244110cc63484f062
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/logger/logger.c

index 0a441b2..fc418e2 100644 (file)
@@ -43,9 +43,7 @@ static void dispatch_event_reader_sink(struct logger *server, struct epoll_event
 static void dispatch_event_reader_source(struct logger *server, struct epoll_event *event);
 void reader_free(struct reader* reader);
 static void logger_free(struct logger* l);
-static int parse_args(int argc, char **argv, struct buf_params *b);
 int socket_initialize(struct sock_data *sock, struct log_buffer *buffer, service_socket_t service_socket, struct socket_config_data *data);
-static void help();
 
 /** global state when logger is not interrupted by any handled signals */
 static volatile sig_atomic_t g_logger_run = 1;
@@ -2137,6 +2135,35 @@ static void free_config_data(struct logger_config_data *data)
 }
 
 /**
+ * @brief Parse logfile line
+ * @detail Parses a logfile config line
+ * @param[in] key Config entry key
+ * @param[in] value Config entry value
+ * @param[in] userdata Userdata
+ */
+void parse_logfile_config(void *value, void *userdata)
+{
+       assert(value);
+       assert(userdata);
+
+       struct logger *server = (struct logger *) userdata;
+       struct reader *rd = NULL;
+       char *configline = (char *) value;
+
+       int r = parse_command_line(configline, NULL, server, &rd);
+       if (r == 0)
+               add_reader(server, rd);
+       else {
+               errno = -r;
+               printf("Warning: unable to add logutil reader for provided configuration. Ignoring.\n"
+                      "  Config line: %s\n"
+                      "  Reason given: %m\n",
+                      configline);
+       }
+}
+
+#ifndef UNIT_TEST
+/**
  * @brief Print help
  * @details Prints basic usage tips
  */
@@ -2157,7 +2184,7 @@ static void help()
  * @param[out] b Buffering parameters
  * @return 0 or 1 on success, else -errno. Nonzero if the program is to close.
  */
-int parse_args(int argc, char **argv, struct buf_params *b)
+static int parse_args(int argc, char **argv, struct buf_params *b)
 {
        int option;
 
@@ -2189,34 +2216,6 @@ int parse_args(int argc, char **argv, struct buf_params *b)
 }
 
 /**
- * @brief Parse logfile line
- * @detail Parses a logfile config line
- * @param[in] key Config entry key
- * @param[in] value Config entry value
- * @param[in] userdata Userdata
- */
-void parse_logfile_config(void *value, void *userdata)
-{
-       assert(value);
-       assert(userdata);
-
-       struct logger *server = (struct logger *) userdata;
-       struct reader *rd = NULL;
-       char *configline = (char *) value;
-
-       int r = parse_command_line(configline, NULL, server, &rd);
-       if (r == 0)
-               add_reader(server, rd);
-       else {
-               errno = -r;
-               printf("Warning: unable to add logutil reader for provided configuration. Ignoring.\n"
-                      "  Config line: %s\n"
-                      "  Reason given: %m\n",
-                      configline);
-       }
-}
-
-/**
  * @brief Finalize initialisation
  * @details Do misc stuff needed at the end of the initialisation
  * @param[in] data configuration dat to read logfiles config lines from
@@ -2235,7 +2234,6 @@ static int finalize_init(struct logger_config_data *data, struct logger *server)
        return 0;
 }
 
-#ifndef UNIT_TEST
 /**
  * @brief The logger
  * @return 0 on success, nonzero on failure