From e6e9415a03676d53a610ce3963fc5a27f8639576 Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Thu, 4 Oct 2018 18:34:00 +0200 Subject: [PATCH] =?UTF-8?q?testing=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hgignore | 2 ++ Makefile | 12 +++++++++--- test_adapter.cc | 9 +++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.hgignore b/.hgignore index 24cfe49..12b6dcc 100644 --- a/.hgignore +++ b/.hgignore @@ -4,3 +4,5 @@ syntax: glob *.swp ws test_adapter +.??* +lib diff --git a/Makefile b/Makefile index c39dcc1..f2bc3a0 100644 --- a/Makefile +++ b/Makefile @@ -19,13 +19,19 @@ all: $(TARGET) $(TARGET): $(WITHOUT_TESTS) ar -rc $@ $^ -.PHONY: clean test install uninstall +.PHONY: clean distclean test install uninstall clean: - rm -f $(TARGET) $(OBJECTS) *.a test_adapter + rm -f $(TARGET) $(OBJECTS) *.a test_adapter lib + +distclean: clean + rm -Rf .gnupg .pEp_management* test: test_adapter - ./test_adapter +ifeq ($(HOME),$(PREFIX)) + -ln -fs $$HOME/lib +endif + HOME=$$(pwd) ./test_adapter test_adapter: test_adapter.o $(TARGET) $(CXX) -o $@ -L$(PEP)/lib -lpEpEngine -L. -lpEpAdapter $< diff --git a/test_adapter.cc b/test_adapter.cc index 4f2241e..c8b47c5 100644 --- a/test_adapter.cc +++ b/test_adapter.cc @@ -5,6 +5,7 @@ #include #include #include +#include using namespace pEp; using namespace std; @@ -23,10 +24,18 @@ PEP_STATUS notifyHandshake(void *obj, pEp_identity *me, pEp_identity *partner, s int main() { + cout << "creating identity for me\n"; + pEp_identity *me = new_identity("alice@peptest.ch", NULL, "23", "Who the F* is Alice"); + assert(me); + PEP_STATUS status = myself(Adapter::session(), me); + throw_status(status); + + cout << "starting the adapter including sync\n"; Adapter(messageToSend, notifyHandshake); sleep(3); Adapter::shutdown(); + free_identity(me); return 0; }