Browse Source

testing…

LPA-1
Volker Birk 4 years ago
parent
commit
e6e9415a03
3 changed files with 20 additions and 3 deletions
  1. +2
    -0
      .hgignore
  2. +9
    -3
      Makefile
  3. +9
    -0
      test_adapter.cc

+ 2
- 0
.hgignore View File

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

+ 9
- 3
Makefile View File

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


+ 9
- 0
test_adapter.cc View File

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