Przeglądaj źródła

Adapt unit test for NO_FILES build

A PUT request without login will return 401 (Not Authorized) if there is a file system,
and 405 (Method Not Allowed) if there is no file system (= NO_FILES defined).
bel 10 lat temu
rodzic
commit
2c5025f52d
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      test/public_server.c

+ 4 - 0
test/public_server.c

@@ -573,7 +573,11 @@ START_TEST(test_request_handlers)
 	ri = mg_get_request_info(conn);
 	ri = mg_get_request_info(conn);
 
 
 	ck_assert(ri != NULL);
 	ck_assert(ri != NULL);
+#if defined(NO_FILES)
+	ck_assert_str_eq(ri->uri, "405"); /* method not allowed */
+#else
 	ck_assert_str_eq(ri->uri, "401"); /* not authorized */
 	ck_assert_str_eq(ri->uri, "401"); /* not authorized */
+#endif
 	mg_close_connection(conn);
 	mg_close_connection(conn);