/******************************************************************************* * unittests/libretroshare/serialiser/rsturtleitems_test.cc * * * * Copyright 2007-2008 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * * published by the Free Software Foundation, either version 3 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ #include #include #include #include "turtle/rsturtleitem.h" #include "ft/ftturtlefiletransferitem.h" #include "support.h" #include "rstlvutil.h" RsSerialType* init_item(CompressedChunkMap& map) { map._map.clear() ; for(uint32_t i=0;i<15;++i) map._map.push_back(rand()) ; } bool operator==(const CompressedChunkMap& m1,const CompressedChunkMap& m2) { if(m1._map.size() != m2._map.size()) return false ; for(uint32_t i=0;i::const_iterator i1(it1.result.begin()) ; std::list::const_iterator i2(it2.result.begin()) ; for(;i1!=it1.result.end() && i2!=it2.result.end();++i1,++i2) if( !(*i1 == *i2)) return false ; return true ; } TEST(libretroshare_serialiser, RsTurtleItem) { for(uint32_t i=0;i<20;++i) { //test_RsItem(); //test_RsItem(); //test_RsItem(); //test_RsItem(); test_RsItem(); test_RsItem(); test_RsItem(); test_RsItem(); test_RsItem(); } }