-DNDEBUG
endif
-check_PROGRAMS = basic.tests
+check_PROGRAMS = basic.tests qbittorrent.tests
TESTS = $(check_PROGRAMS)
#if ENABLE_MEMCHECK
$(common_SOURCES) \
basic.tests.c
+qbittorrent_tests_SOURCES = \
+ $(common_SOURCES) \
+ qbittorrent.tests.c
+
clean-local:
-rm -rf $(TEST_DIRECTORY)
--- /dev/null
+#include<test_utils.h>
+
+int main();
+void qbittorrent_integration_test();
+
+int main() {
+ setup_env();
+
+ qbittorrent_integration_test();
+
+ reset_env();
+
+ return EXIT_SUCCESS;
+}
+
+#define QBITTORRENT_PORT "9634"
+
+void qbittorrent_integration_test() {
+ struct addrinfo hints, *res;
+ int sock_fd;
+
+ memset(&hints,0,sizeof(hints));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+
+ getaddrinfo("127.0.0.1",QBITTORRENT_PORT,&hints,&res);
+
+ sock_fd = socket(res->ai_family,res->ai_socktype,res->ai_protocol);
+ assert(sock_fd>0);
+
+ assert(0==connect(sock_fd,res->ai_addr,res->ai_addrlen));
+
+ close(sock_fd);
+}