testing…
authorVolker Birk <vb@pep.foundation>
Thu, 04 Oct 2018 18:34:00 +0200
changeset 221c1c9989268f
parent 21 a6b5ea94ad6e
child 23 1e6e8f74ed59
testing…
.hgignore
Makefile
test_adapter.cc
     1.1 --- a/.hgignore	Thu Oct 04 18:12:53 2018 +0200
     1.2 +++ b/.hgignore	Thu Oct 04 18:34:00 2018 +0200
     1.3 @@ -4,3 +4,5 @@
     1.4  *.swp
     1.5  ws
     1.6  test_adapter
     1.7 +.??*
     1.8 +lib
     2.1 --- a/Makefile	Thu Oct 04 18:12:53 2018 +0200
     2.2 +++ b/Makefile	Thu Oct 04 18:34:00 2018 +0200
     2.3 @@ -19,13 +19,19 @@
     2.4  $(TARGET): $(WITHOUT_TESTS)
     2.5  	ar -rc $@ $^
     2.6  
     2.7 -.PHONY: clean test install uninstall
     2.8 +.PHONY: clean distclean test install uninstall
     2.9  
    2.10  clean:
    2.11 -	rm -f $(TARGET) $(OBJECTS) *.a test_adapter
    2.12 +	rm -f $(TARGET) $(OBJECTS) *.a test_adapter lib
    2.13 +
    2.14 +distclean: clean
    2.15 +	rm -Rf .gnupg .pEp_management*
    2.16  
    2.17  test: test_adapter
    2.18 -	./test_adapter
    2.19 +ifeq ($(HOME),$(PREFIX))
    2.20 +	-ln -fs $$HOME/lib
    2.21 +endif
    2.22 +	HOME=$$(pwd) ./test_adapter
    2.23  
    2.24  test_adapter: test_adapter.o $(TARGET)
    2.25  	$(CXX) -o $@ -L$(PEP)/lib -lpEpEngine -L. -lpEpAdapter $<
     3.1 --- a/test_adapter.cc	Thu Oct 04 18:12:53 2018 +0200
     3.2 +++ b/test_adapter.cc	Thu Oct 04 18:34:00 2018 +0200
     3.3 @@ -5,6 +5,7 @@
     3.4  #include <iostream>
     3.5  #include <assert.h>
     3.6  #include <unistd.h>
     3.7 +#include <pEp/keymanagement.h>
     3.8  
     3.9  using namespace pEp;
    3.10  using namespace std;
    3.11 @@ -23,10 +24,18 @@
    3.12  
    3.13  int main()
    3.14  {
    3.15 +    cout << "creating identity for me\n";
    3.16 +    pEp_identity *me = new_identity("alice@peptest.ch", NULL, "23", "Who the F* is Alice");
    3.17 +    assert(me);
    3.18 +    PEP_STATUS status = myself(Adapter::session(), me);
    3.19 +    throw_status(status);
    3.20 +
    3.21 +    cout << "starting the adapter including sync\n";
    3.22      Adapter(messageToSend, notifyHandshake);
    3.23      sleep(3);
    3.24      Adapter::shutdown();
    3.25  
    3.26 +    free_identity(me);
    3.27      return 0;
    3.28  }
    3.29