Kaynağa Gözat

Restoring test_qa test_qa_sock to a working state.

Adding dummy.crt which wasn't yet on the source tree, and using relative paths
instead of full path when loading it.
Fixing makefile error due to which the wrong main() function was being taken.
Michele Orrù 11 yıl önce
ebeveyn
işleme
f8e9438eac
3 değiştirilmiş dosya ile 33 ekleme ve 3 silme
  1. 2 2
      src/tests/Makefile.am
  2. 30 0
      src/tests/dummy.crt
  3. 1 1
      src/tests/test_qa.c

+ 2 - 2
src/tests/Makefile.am

@@ -7,7 +7,7 @@ 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
+test_qa_SOURCES = test_qa.c
+test_qa_LDADD = ../qa_sock.o ../qa.o ../questions/allquestions.o ../questions/libquestions.a
 
 TESTS = $(check_PROGRAMS)

+ 30 - 0
src/tests/dummy.crt

@@ -0,0 +1,30 @@
+-----BEGIN CERTIFICATE-----
+MIIE3zCCA8egAwIBAgIQaLrqpO+0m3j1KxmYyr+CGzANBgkqhkiG9w0BAQUFADBB
+MQswCQYDVQQGEwJGUjESMBAGA1UEChMJR0FOREkgU0FTMR4wHAYDVQQDExVHYW5k
+aSBTdGFuZGFyZCBTU0wgQ0EwHhcNMTMwNTE1MDAwMDAwWhcNMTQwNTE5MjM1OTU5
+WjBgMSEwHwYDVQQLExhEb21haW4gQ29udHJvbCBWYWxpZGF0ZWQxJDAiBgNVBAsT
+G0dhbmRpIFN0YW5kYXJkIFdpbGRjYXJkIFNTTDEVMBMGA1UEAxQMKi5yaXNldXAu
+bmV0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0728UY+67ogXceEz
+2wTXgYix9EXowEk8Eb5LcW7mitYzhM0rsJfDp1V+jsJy5h1nJJQYcW2CAmKm1OkX
+Ld1vYZHEToHOmarkDIsB6Bx44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6YfnkJTP0yo8HYWFdfZfOFyOPde7YZ+n4Dkh
+zfXP3KXrHdgWv5F+H66HWjEWz5HPjBdy9hOpFM5KGJyxfu8yRGH19Ujh3etMqaPD
+5fGMo/K82hpv6NX+BK2CitqTiUM5uYNX0qt2HiHjNmKyATvLnfX7EICQjWStdwB8
+8qMQ
+-----END CERTIFICATE-----
+

+ 1 - 1
src/tests/test_qa.c

@@ -16,7 +16,7 @@ void test_get_local_cert(void)
   strcpy(path, "/lifting/me/higher/keeps/me/lifting.crt");
   assert(!get_local_cert(path));
 
-  strcpy(path, "/home/maker/dev/uni/thesis/src/dummy.crt");
+  strcpy(path, "dummy.crt");
   crt = get_local_cert(path);
   assert(crt);
   pkey = X509_get_pubkey(crt);