Fix UnitTests Compilation

This commit is contained in:
Phenom 2016-04-04 17:18:42 +02:00
parent d34b2e885a
commit f2b995768b
5 changed files with 36 additions and 18 deletions

View File

@ -122,28 +122,42 @@ const RsPgpId& rs_nxs_test::RsDummyPgpUtils::getPGPOwnId() {
return mOwnId; return mOwnId;
} }
RsPgpId rs_nxs_test::RsDummyPgpUtils::getPGPId(const RsPeerId& sslid) { RsPgpId rs_nxs_test::RsDummyPgpUtils::getPGPId(const RsPeerId& /*sslid*/) {
return RsPgpId().random(); return RsPgpId().random();
} }
bool rs_nxs_test::RsDummyPgpUtils::getGPGAllList(std::list<RsPgpId>& ids) { bool rs_nxs_test::RsDummyPgpUtils::getGPGAllList(std::list<RsPgpId>& /*ids*/) {
return true; return true;
} }
bool rs_nxs_test::RsDummyPgpUtils::getKeyFingerprint(const RsPgpId& id, bool rs_nxs_test::RsDummyPgpUtils::getKeyFingerprint(const RsPgpId& /*id*/,
PGPFingerprintType& fp) const { PGPFingerprintType& /*fp*/
) const {
return true; return true;
} }
bool rs_nxs_test::RsDummyPgpUtils::VerifySignBin(const void* data, uint32_t len, bool rs_nxs_test::RsDummyPgpUtils::parseSignature(unsigned char* /*sign*/,
unsigned char* sign, unsigned int signlen, unsigned int /*signlen*/,
const PGPFingerprintType& withfingerprint) { RsPgpId& /*issuer*/
) const {
return true; return true;
} }
bool rs_nxs_test::RsDummyPgpUtils::askForDeferredSelfSignature(const void* data, bool rs_nxs_test::RsDummyPgpUtils::VerifySignBin(const void* /*data*/,
const uint32_t len, unsigned char* sign, unsigned int* signlen, uint32_t /*len*/,
int& signature_result) { unsigned char* /*sign*/,
unsigned int /*signlen*/,
const PGPFingerprintType& /*withfingerprint*/
) {
return true;
}
bool rs_nxs_test::RsDummyPgpUtils::askForDeferredSelfSignature(const void* /*data*/,
const uint32_t /*len*/,
unsigned char* /*sign*/,
unsigned int* /*signlen*/,
int& /*signature_result*/
) {
return true; return true;
} }

View File

@ -155,6 +155,7 @@ namespace rs_nxs_test
bool getGPGAllList(std::list<RsPgpId> &ids) ; bool getGPGAllList(std::list<RsPgpId> &ids) ;
bool getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const; bool getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const;
bool parseSignature(unsigned char *sign, unsigned int signlen, RsPgpId& issuer) const;
bool VerifySignBin(const void *data, uint32_t len, unsigned char *sign, unsigned int signlen, const PGPFingerprintType& withfingerprint); bool VerifySignBin(const void *data, uint32_t len, unsigned char *sign, unsigned int signlen, const PGPFingerprintType& withfingerprint);
bool askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen,int& signature_result ); bool askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen,int& signature_result );

View File

@ -12,7 +12,8 @@
#include "gxs/rsdataservice.h" #include "gxs/rsdataservice.h"
#include "nxsdummyservices.h" #include "nxsdummyservices.h"
#include "../common/data_support.h" #include "../common/data_support.h"
#include <auto_ptr.h> //#include <auto_ptr.h> //Already include in memory, a better way.
#include <memory>
using namespace rs_nxs_test; using namespace rs_nxs_test;

View File

@ -42,7 +42,6 @@ void FakePgpAuxUtils::addPeerListToPgpList(const std::list<RsPeerId> &ids)
} }
} }
void FakePgpAuxUtils::addPeerIdToPgpList(const RsPeerId &id) void FakePgpAuxUtils::addPeerIdToPgpList(const RsPeerId &id)
{ {
RsPgpId pgpId = getPGPId(id); RsPgpId pgpId = getPGPId(id);
@ -52,7 +51,6 @@ void FakePgpAuxUtils::addPeerIdToPgpList(const RsPeerId &id)
} }
} }
const RsPgpId & FakePgpAuxUtils::getPGPOwnId() const RsPgpId & FakePgpAuxUtils::getPGPOwnId()
{ {
return mOwnId; return mOwnId;
@ -74,7 +72,6 @@ RsPgpId FakePgpAuxUtils::getPGPId(const RsPeerId& sslid)
return pgpId; return pgpId;
} }
bool FakePgpAuxUtils::getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const bool FakePgpAuxUtils::getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const
{ {
/* convert an sslId */ /* convert an sslId */
@ -93,7 +90,12 @@ bool FakePgpAuxUtils::getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp
return true; return true;
} }
bool FakePgpAuxUtils::VerifySignBin(const void *data, uint32_t len, unsigned char *sign, unsigned int signlen, const PGPFingerprintType& withfingerprint) bool FakePgpAuxUtils::parseSignature(unsigned char* /*sign*/, unsigned int /*signlen*/, RsPgpId& /*issuer*/) const
{
return true;
}
bool FakePgpAuxUtils::VerifySignBin(const void* /*data*/, uint32_t /*len*/, unsigned char* /*sign*/, unsigned int /*signlen*/, const PGPFingerprintType& /*withfingerprint*/)
{ {
return true; return true;
} }
@ -104,8 +106,7 @@ bool FakePgpAuxUtils::getGPGAllList(std::list<RsPgpId> &ids)
return true; return true;
} }
bool FakePgpAuxUtils::askForDeferredSelfSignature(const void* /*data*/, const uint32_t /*len*/, unsigned char *sign, unsigned int *signlen,int& signature_result )
bool FakePgpAuxUtils::askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen,int& signature_result )
{ {
for(int i = 0; i < *signlen; i++) for(int i = 0; i < *signlen; i++)
{ {

View File

@ -34,8 +34,9 @@ public:
virtual const RsPgpId &getPGPOwnId(); virtual const RsPgpId &getPGPOwnId();
virtual RsPgpId getPGPId(const RsPeerId& sslid); virtual RsPgpId getPGPId(const RsPeerId& sslid);
virtual bool getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const; virtual bool getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const;
virtual bool parseSignature(unsigned char *sign, unsigned int signlen, RsPgpId& issuer) const;
virtual bool VerifySignBin(const void *data, uint32_t len, unsigned char *sign, unsigned int signlen, const PGPFingerprintType& withfingerprint); virtual bool VerifySignBin(const void *data, uint32_t len, unsigned char *sign, unsigned int signlen, const PGPFingerprintType& withfingerprint);
virtual bool askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen,int& signature_result ); virtual bool askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen,int& signature_result );