summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2021-04-08 06:36:50 +0000
committerAlan Antonuk <alan.antonuk@gmail.com>2021-04-07 23:41:15 -0700
commita3299298ad8b75ffa294529e217882f2755821f6 (patch)
treede4f7b1577eddf8b25171a46b48f86c7690b6d4e /tests
parent853734dfe799e70d44a9ce357198d3a3260c1be7 (diff)
downloadrabbitmq-c-a3299298ad8b75ffa294529e217882f2755821f6.tar.gz
ssl: remove obsolete amqp_hostcheck
This is dead code, obsoleted by #673 (setting minimum OpenSSL v1.1.1). Signed-off-by: GitHub <noreply@github.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt5
-rw-r--r--tests/test_hostcheck.c71
2 files changed, 0 insertions, 76 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index f745e3f..d365b0a 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -22,11 +22,6 @@ target_link_libraries(test_tables rabbitmq-static)
add_test(tables test_tables)
configure_file(test_tables.expected ${CMAKE_CURRENT_BINARY_DIR}/tests/test_tables.expected COPYONLY)
-add_executable(test_hostcheck
- test_hostcheck.c
- ../librabbitmq/amqp_hostcheck.c)
-add_test(hostcheck test_hostcheck)
-
add_executable(test_status_enum
test_status_enum.c)
target_link_libraries(test_status_enum rabbitmq-static)
diff --git a/tests/test_hostcheck.c b/tests/test_hostcheck.c
deleted file mode 100644
index 24c0d6c..0000000
--- a/tests/test_hostcheck.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2014 Michael Steinert
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "amqp_hostcheck.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-static void hostcheck_success(const char *match_pattern, const char *url) {
- int ok;
-
- ok = amqp_hostcheck(match_pattern, url);
- if (!ok) {
- fprintf(stderr, "Expected hostname check to pass, but didn't: %s (%s)\n",
- url, match_pattern);
- abort();
- }
-
- fprintf(stdout, "ok: [success] %s, %s\n", url, match_pattern);
-}
-
-static void hostcheck_fail(const char *match_pattern, const char *url) {
- int ok;
-
- ok = amqp_hostcheck(match_pattern, url);
- if (ok) {
- fprintf(stderr, "Expected hostname check to fail, but didn't: %s (%s)\n",
- url, match_pattern);
- abort();
- }
-
- fprintf(stdout, "ok: [fail] %s, %s\n", url, match_pattern);
-}
-
-int main(void) {
- hostcheck_success("www.rabbitmq.com", "www.rabbitmq.com");
- hostcheck_success("www.rabbitmq.com", "wWw.RaBbItMq.CoM");
- hostcheck_success("*.rabbitmq.com", "wWw.RaBbItMq.CoM");
- hostcheck_fail("rabbitmq.com", "www.rabbitmq.com");
- hostcheck_success("*.rabbitmq.com", "www.rabbitmq.com");
- hostcheck_fail("*.com", "www.rabbitmq.com");
- hostcheck_fail("*.rabbitmq.com", "long.url.rabbitmq.com");
- hostcheck_success("*.url.rabbitmq.com", "long.url.rabbitmq.com");
-
- return 0;
-}