Browse Source

Fix unused variables in default unit test build

Kevin Wojniak 10 years ago
parent
commit
d7d9469db8
2 changed files with 14 additions and 0 deletions
  1. 5 0
      src/civetweb.c
  2. 9 0
      test/unit_test.c

+ 5 - 0
src/civetweb.c

@@ -5931,6 +5931,11 @@ static void handle_websocket_request(struct mg_connection *conn, const char *pat
 #ifdef USE_LUA
     int lua_websock = 0;
 #endif
+    
+#ifndef USE_LUA
+    (void)path;
+    (void)is_script_resource;
+#endif
 
     if (version == NULL || strcmp(version, "13") != 0) {
         send_http_error(conn, 426, "%s", "Protocol upgrade required");

+ 9 - 0
test/unit_test.c

@@ -210,7 +210,9 @@ static long fetch_data_size = 1024*1024;
 static char *fetch_data;
 static const char *inmemory_file_data = "hi there";
 static const char *upload_filename = "upload_test.txt";
+#if 0
 static const char *upload_filename2 = "upload_test2.txt";
+#endif
 static const char *upload_ok_message = "upload successful";
 
 static const char *open_file_cb(const struct mg_connection *conn,
@@ -518,6 +520,7 @@ static void test_mg_download(int use_ssl) {
     mg_close_connection(conn);
 
     if (use_ssl) {
+#ifndef NO_SSL
         /* Test SSL redirect */
         ASSERT((conn = mg_download("localhost", atoi(HTTP_REDIRECT_PORT), 0,
             ebuf, sizeof(ebuf), "%s",
@@ -527,6 +530,7 @@ static void test_mg_download(int use_ssl) {
         ASSERT(h != NULL);
         ASSERT(strcmp(h, "https://127.0.0.1:" HTTPS_PORT "/data/4711") == 0);
         mg_close_connection(conn);
+#endif
     }
 
     /* Test new API */
@@ -558,6 +562,10 @@ static void test_mg_download(int use_ssl) {
 
 static int websocket_data_handler(struct mg_connection *conn, int flags, char *data, size_t data_len)
 {
+    (void)conn;
+    (void)flags;
+    (void)data;
+    (void)data_len;
     return 1;
 }
 
@@ -882,6 +890,7 @@ static void test_request_replies(void) {
 static int request_test_handler(struct mg_connection *conn, void *cbdata)
 {
     ASSERT(cbdata == (void*)7);
+    (void)conn;
     return 1;
 }