Browse Source

testing…

LPA-1
Volker Birk 7 years ago
parent
commit
e6e9415a03
  1. 2
      .hgignore
  2. 12
      Makefile
  3. 9
      test_adapter.cc

2
.hgignore

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

12
Makefile

@ -19,13 +19,19 @@ all: $(TARGET)
$(TARGET): $(WITHOUT_TESTS) $(TARGET): $(WITHOUT_TESTS)
ar -rc $@ $^ ar -rc $@ $^
.PHONY: clean test install uninstall .PHONY: clean distclean test install uninstall
clean: 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: test_adapter
./test_adapter ifeq ($(HOME),$(PREFIX))
-ln -fs $$HOME/lib
endif
HOME=$$(pwd) ./test_adapter
test_adapter: test_adapter.o $(TARGET) test_adapter: test_adapter.o $(TARGET)
$(CXX) -o $@ -L$(PEP)/lib -lpEpEngine -L. -lpEpAdapter $< $(CXX) -o $@ -L$(PEP)/lib -lpEpEngine -L. -lpEpAdapter $<

9
test_adapter.cc

@ -5,6 +5,7 @@
#include <iostream> #include <iostream>
#include <assert.h> #include <assert.h>
#include <unistd.h> #include <unistd.h>
#include <pEp/keymanagement.h>
using namespace pEp; using namespace pEp;
using namespace std; using namespace std;
@ -23,10 +24,18 @@ PEP_STATUS notifyHandshake(void *obj, pEp_identity *me, pEp_identity *partner, s
int main() 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); Adapter(messageToSend, notifyHandshake);
sleep(3); sleep(3);
Adapter::shutdown(); Adapter::shutdown();
free_identity(me);
return 0; return 0;
} }

Loading…
Cancel
Save