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; }