Kaynağa Gözat

make check available also for test_qa and test_qa_sock.

Something strange, test_qa is failing here. Checking later.
Michele Orrù 11 yıl önce
ebeveyn
işleme
2a775b9aaf

+ 1 - 1
configure.ac

@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 # Process this file with autoconf to produce a configure script.
 
 
 AC_PREREQ([2.65])
 AC_PREREQ([2.65])
-AC_INIT([question_authority], [0.1], [maker@tumbolandia.n])
+AC_INIT([question_authority], [0.1], [maker@tumbolandia.net])
 AM_INIT_AUTOMAKE
 AM_INIT_AUTOMAKE
 AC_CONFIG_SRCDIR([src/qa.c])
 AC_CONFIG_SRCDIR([src/qa.c])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_HEADERS([config.h])

+ 0 - 6
src/qa.c

@@ -14,12 +14,6 @@
 #include "qa/questions/questions.h"
 #include "qa/questions/questions.h"
 #include "qa/qa_sock.h"
 #include "qa/qa_sock.h"
 
 
-/** BIO wrapper around stdout */
-BIO* bio_out;
-/** BIO wrapper around srderr */
-BIO* bio_err;
-
-
 void qa_abort(const char *reason)
 void qa_abort(const char *reason)
 {
 {
   //ERR_print_errors_fp(stderr);
   //ERR_print_errors_fp(stderr);

+ 2 - 2
src/questions/Makefile.am

@@ -1,8 +1,8 @@
 SUBDIRS = tests/
 SUBDIRS = tests/
 
 
-AM_CFLAGS = -I ../include/
+AM_CFLAGS = -I ../include/ -Wall
 AM_LDFLAGS = -lssl -lcrypto
 AM_LDFLAGS = -lssl -lcrypto
 
 
 lib_LIBRARIES = libquestions.a
 lib_LIBRARIES = libquestions.a
-libquestions_a_SOURCES = wiener.c pollard.c example.c allquestions.c qarith.c qstrings.c
+libquestions_a_SOURCES = wiener.c pollard.c example.c dixon.c allquestions.c qarith.c qstrings.c
 # da fuck liquestions_a_HEADERS = qwiener.h questions.h
 # da fuck liquestions_a_HEADERS = qwiener.h questions.h

+ 1 - 2
src/questions/dixon.c

@@ -185,7 +185,7 @@ int dixon_question_ask(X509* cert) {
   RSA *rsa;
   RSA *rsa;
   /* key data */
   /* key data */
   BIGNUM
   BIGNUM
-    *n, *e,
+    *n,
     *p, *q;
     *p, *q;
   /* x, y */
   /* x, y */
   BIGNUM
   BIGNUM
@@ -202,7 +202,6 @@ int dixon_question_ask(X509* cert) {
 
 
   rsa = X509_get_pubkey(cert)->pkey.rsa;
   rsa = X509_get_pubkey(cert)->pkey.rsa;
   n = rsa->n;
   n = rsa->n;
-  e = rsa->e;
   U_bucket = malloc(sizeof(ssize_t) * U_SIZE);
   U_bucket = malloc(sizeof(ssize_t) * U_SIZE);
   even_powers = malloc(sizeof(char) * B_size);
   even_powers = malloc(sizeof(char) * B_size);
   ctx = BN_CTX_new();
   ctx = BN_CTX_new();

+ 0 - 2
src/questions/include/qstrings.h

@@ -1,8 +1,6 @@
 #ifndef _QA_QSTRINGS_H_
 #ifndef _QA_QSTRINGS_H_
 #define _QA_QSTRINGS_H_
 #define _QA_QSTRINGS_H_
 
 
-#include <stddef.h>
-
 int is_vzero(const void *v, size_t len);
 int is_vzero(const void *v, size_t len);
 
 
 #endif /* _QA_QSTRINGS_H_ */
 #endif /* _QA_QSTRINGS_H_ */

+ 2 - 0
src/questions/qstrings.c

@@ -4,6 +4,8 @@
  * \brief Extend stdlib support with some common functions used in questions.
  * \brief Extend stdlib support with some common functions used in questions.
  *
  *
  */
  */
+#include <stddef.h>
+
 #include "qa/questions/qstrings.h"
 #include "qa/questions/qstrings.h"
 
 
 
 

+ 5 - 3
src/questions/tests/Makefile.am

@@ -1,10 +1,12 @@
 # unittesting my ass
 # unittesting my ass
 AM_CFLAGS = -I ../../include/
 AM_CFLAGS = -I ../../include/
-AM_LDFLAGS = -lcrypto -lssl -L ../libquestions.a
+AM_LDFLAGS = -lcrypto -lssl
 
 
-check_PROGRAMS = test_qstrings test_qarith
+check_PROGRAMS = test_qarith test_qstrings
 
 
 test_qstrings_SOURCES = test_qstrings.c
 test_qstrings_SOURCES = test_qstrings.c
+test_qstrings_LDADD = ../libquestions.a
 test_qarith_SOURCES = test_qarith.c
 test_qarith_SOURCES = test_qarith.c
+test_qarith_LDADD = ../libquestions.a
 
 
-TESTS = test_qstrings test_qarith
+TESTS = test_qarith test_qstrings

+ 13 - 0
src/tests/Makefile.am

@@ -0,0 +1,13 @@
+# unittesting my ass
+AM_CFLAGS = -I ../include/
+AM_LDFLAGS = -lcrypto -lssl
+
+check_PROGRAMS = test_qa_sock test_qa
+
+test_qa_sock_SOURCES = test_qa_sock.c
+test_qa_sock_LDADD = ../qa_sock.o
+
+test_qa_SOURCES = test_qa
+test_qa_LDADD = ../qa_sock.o ../cmdline.o ../qa.o ../questions/allquestions.o ../questions/libquestions.a
+
+TESTS = test_qa_sock test_qa

+ 1 - 1
src/tests/test_qa.c

@@ -3,7 +3,7 @@
 
 
 #include <openssl/x509.h>
 #include <openssl/x509.h>
 
 
-#include "qa.h"
+#include "qa/qa.h"
 
 
 
 
 void test_get_local_cert(void)
 void test_get_local_cert(void)