testing…

LPA-1
Volker Birk 5 years ago
parent 282a88ce8a
commit e6e9415a03

@ -4,3 +4,5 @@ syntax: glob
*.swp
ws
test_adapter
.??*
lib

@ -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 $<

@ -5,6 +5,7 @@
#include <iostream>
#include <assert.h>
#include <unistd.h>
#include <pEp/keymanagement.h>
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;
}

Loading…
Cancel
Save