From 7da0e9b3f37c9703d71de62e70e30d8f4684b815 Mon Sep 17 00:00:00 2001 From: chrisparker126 Date: Tue, 20 Nov 2007 01:13:31 +0000 Subject: [PATCH] test file for last four tlv objects git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@263 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../src/serialiser/tlvconfig_test.cc | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100755 libretroshare/src/serialiser/tlvconfig_test.cc diff --git a/libretroshare/src/serialiser/tlvconfig_test.cc b/libretroshare/src/serialiser/tlvconfig_test.cc new file mode 100755 index 000000000..50c0704b5 --- /dev/null +++ b/libretroshare/src/serialiser/tlvconfig_test.cc @@ -0,0 +1,132 @@ + +/****************************************************************** + * tlvfileitem test. + * + * + */ + +#include +#include +#include "rstlvtypes.h" +#include "rstlvutil.h" +#include "utest.h" + +INITTEST(); + +static int testRsTlvPeerIdSet(); +static int testRsTlvServiceIdSet(); +static int testRsTlvKeyValue(); +static int testRsTlvKeyValueSet(); + + +int main() +{ + std::cerr << "RsTlvConfig[Item/Data/...] Tests" << std::endl; + + testRsTlvPeerIdSet(); + testRsTlvServiceIdSet();//tbd + testRsTlvKeyValue();//tbd + testRsTlvKeyValueSet();//tbd + + + FINALREPORT("RsTlvConfig[Item/Data/...] Tests"); + + return TESTRESULT(); +} + +int testRsTlvPeerIdSet() +{ + + RsTlvPeerIdSet i1, i2; // one to set and other to get + + std::string testString; + + std::string randString[5]; + randString[0] = "e$424!£!£"; + randString[1] = "e~:@L{L{KHKG"; + randString[2] = "e{@O**/*/*"; + randString[3] = "e?<HG£!£%$"; + randString[4] = "e>HG£!£%$"; + randString[4] = "e>