diff --git a/src/Syncs/CPISync.cpp b/src/Syncs/CPISync.cpp index 60cb816..d7cca5d 100644 --- a/src/Syncs/CPISync.cpp +++ b/src/Syncs/CPISync.cpp @@ -282,8 +282,9 @@ Logger::gLog(Logger::METHOD,"Entering CPISync::set_reconcile"); for (itCPI = CPI_hash.begin(); itCPI != CPI_hash.end(); itCPI++) append(delta_self, to_ZZ_p(itCPI->first)); - } else // otherSetSize >=1 - the other set has something - if (CPI_hash.empty()) { // I have nothing new + } else if (CPI_hash.empty()) { // I have nothing new // otherSetSize >=1 - the other set has something + Logger::gLog(Logger::METHOD, + "CPISync::set_reconcile:: I have nothing new, the other set has something"); return true; } else { // we both have something new vec_ZZ_p coefficient_P, coefficient_Q; @@ -467,6 +468,7 @@ bool CPISync::SyncClient(const shared_ptr& commSync, listgetXmitBytes()); mySyncStats.increment(SyncStats::RECV,commSync->getRecvBytes()); + Logger::gLog(Logger::METHOD, "client, sync fail, curDiff == maxDiff"); return false; } else { // Send more samples and try again diff --git a/src/Syncs/IBLTMultiset.cpp b/src/Syncs/IBLTMultiset.cpp index 5aecf08..839d958 100644 --- a/src/Syncs/IBLTMultiset.cpp +++ b/src/Syncs/IBLTMultiset.cpp @@ -50,7 +50,6 @@ void IBLTMultiset::_insertModular(long plusOrMinus, ZZ key, ZZ value) { for(int ii=0; ii < N_HASH; ii++){ hash_t hk = _hashK(key, ii); long startEntry = ii * bucketsPerHash; - long pos = startEntry + (hk%bucketsPerHash); IBLTMultiset::HashTableEntry& entry = hashTable.at(startEntry + (hk%bucketsPerHash)); hash_t modHashCheck = _hashK(key, N_HASHCHECK) % LARGE_PRIME; diff --git a/tests/DatasetGenerator.h b/tests/DatasetGenerator.h new file mode 100644 index 0000000..200cb84 --- /dev/null +++ b/tests/DatasetGenerator.h @@ -0,0 +1,321 @@ +// +// Created by Shubham Arora on 7/21/20. +// + +#include +#include +#include + +#ifndef CPISYNC_DATASETGENERATOR_H +#define CPISYNC_DATASETGENERATOR_H + +using namespace std; + + + + +/** + * class to generate testing dataset for unit tests + * also populates the dataset into GenSyncClient and GenSyncServer objects + */ +class DatasetGenerator { +public: + + const static size_t _eltSize = sizeof(randZZ()); // Size of elements stored in sync tests in bytes + const static size_t _largeLimit = static_cast(pow(2, 9)); // Max number of elements for *each* SIMILAR, CLIENT_MINUS_SERVER and SEVER_MINUS_CLIENT in largeSync + + struct Dataset { + vector> server; + vector> client; + multiset reconciled; + string desc; // description of dataset + vector> allObjects; + }; + +/** + * generate list of data for the syncType + * @param isMultiset if true, only returns multiset data + * @param isLargeSync if true, only returns large no of elements in dataset + * @return + */ + static vector + generate(bool isMultiset, bool isLargeSync) { + vector result; + // use a seed + if(isMultiset && isLargeSync) { + Logger::error_and_quit("logic not implemented for large multiset sync"); + return result; + } + else if(isMultiset) { + addMultisetData(result); + return result; + } + else if(isLargeSync) { + addLargeData(result); + return result; + } + + addEmptySets(result); + addOneEmptySet(result); + addSubsetData(result); + addBigDiffData(result); + addHugeDiffData(result); + addEqualData(result); + + return result; + } + +/** + * + * @param GenSyncClient the client to update + * @param GenSyncServer the server to update + * @param dataSet the dataSet from which to initialize client and serer data + */ + static void addElements(GenSync &GenSyncClient, GenSync &GenSyncServer, const DatasetGenerator::Dataset &dataSet) { + // add client data + for (const auto &clientData: dataSet.client) { + GenSyncClient.addElem(clientData); + } + + // add server data + for (const auto &serverData: dataSet.server) { + GenSyncServer.addElem(serverData); + } + } + + + /** + * Adds multiset elements to the testSet Object + * This vector contains SERVER_MINUS_CLIENT elements that are only added to the server, followed by CLIENT_MINUS_SERVER + * elements that are only on the client. The remaining elements are elements that both the server and client have + * @param SIMILAR # of same elems between server and client + * @param SERVER_MINUS_CLIENT # of elems on server but not on client + * @param CLIENT_MINUS_SERVER # of elems on client but not on server + * @param testSet the Dataset object that is filled + */ + static void getMultisetElements(const long SIMILAR, + const long SERVER_MINUS_CLIENT, + const long CLIENT_MINUS_SERVER, + Dataset &testSet) { + std::set dataSet; + ZZ data = rep(random_ZZ_p()); + + long addElemCount = SERVER_MINUS_CLIENT; + //Adds elements to objects pointer for SERVER_MINUS_CLIENT, CLIENT_MINUS_SERVER and SIMILAR (hence 3 loops) + //Must be split to prevent half of a pair being added to SERVER_MINUS_CLIENT and the other half to CLIENT_MINUS_SERVER + for (int jj = 0; jj < 3; jj++) { + for (int kk = 0; kk < addElemCount; kk++) { + //Every 10 elements will have 1 pair and 1 triplet of elements + if (kk % 10 == 0 || kk % 10 == 2 || kk % 10 == 3) { + testSet.allObjects.push_back(make_shared(data)); + } else { //Prevent elements that have already been added from being added again data = randZZ(); + //While you fail to add an element to the set (Because it is a duplicate) + while (!get<1>(dataSet.insert(data))) + data = rep(random_ZZ_p()); + + testSet.allObjects.push_back(make_shared(data)); + } + } + //Re-randomize the data between the different sections of the vector + data = rep(random_ZZ_p()); + + //Change the number of elements to add + if (jj == 0) + addElemCount = CLIENT_MINUS_SERVER; + else if (jj == 1) + addElemCount = SIMILAR; + } + + // add data objects unique to the server + for (int jj = 0; jj < SERVER_MINUS_CLIENT; jj++) + testSet.server.push_back(testSet.allObjects[jj]); + + // add data objects unique to the client + for (int jj = SERVER_MINUS_CLIENT; + jj < SERVER_MINUS_CLIENT + CLIENT_MINUS_SERVER; jj++) + testSet.client.push_back(testSet.allObjects[jj]); + + // add common data objects to both + for (int jj = SERVER_MINUS_CLIENT + CLIENT_MINUS_SERVER; + jj < SERVER_MINUS_CLIENT + CLIENT_MINUS_SERVER + SIMILAR; jj++) { + testSet.client.push_back(testSet.allObjects[jj]); + testSet.server.push_back(testSet.allObjects[jj]); + } + + for (int ii = 0; ii < SIMILAR + SERVER_MINUS_CLIENT + CLIENT_MINUS_SERVER; ii++) { + testSet.reconciled.insert(testSet.allObjects[ii]->print()); + } + + } + + /** + * Adds elements to the testSet object + * This vector contains SERVER_MINUS_CLIENT elements that are only added to the server, followed by CLIENT_MINUS_SERVER + * elements that are only on the client. The remaining elements are elements that both the server and client have + * @param SIMILAR # of same elems between server and client + * @param SERVER_MINUS_CLIENT # of elems on server but not on client + * @param CLIENT_MINUS_SERVER # of elems on client but not on server + * @param testSet the Dataset object to be filled + */ + static void getUniqueElements(const long SIMILAR, + const long SERVER_MINUS_CLIENT, + const long CLIENT_MINUS_SERVER, + Dataset &testSet, const long Rounds = 0, + const long difPerRound = 0 + ) { + +// vector> objectsPtr; + std::set dataSet; + ZZ data = rep(random_ZZ_p()); + + //Creates a set of unique elements + for (unsigned long jj = 0; jj < + SIMILAR + SERVER_MINUS_CLIENT + CLIENT_MINUS_SERVER + + Rounds * difPerRound; jj++) { + //Checks if elements have already been added before adding them to objectsPtr + // to ensure that sync is being + //performed on a set rather than a multiset + data = rep(random_ZZ_p()); + //While you fail to add an element to the set (Because it is a duplicate) + while (!dataSet.insert(data).second) { + if (dataSet.size() == pow(2, _eltSize * 8)) { + string errorMsg = + "Attempting to add more elements to a set than can be represented by " + + toStr(_eltSize) + + " bytes"; + Logger::error_and_quit(errorMsg); + } + data = rep(random_ZZ_p()); + } + testSet.allObjects.push_back(make_shared(data)); + testSet.reconciled.insert(testSet.allObjects[jj]->print()); + } + + // add data objects unique to the server + for (int jj = 0; jj < SERVER_MINUS_CLIENT; jj++) + testSet.server.push_back(testSet.allObjects[jj]); + + // add data objects unique to the client + for (int jj = SERVER_MINUS_CLIENT; + jj < SERVER_MINUS_CLIENT + CLIENT_MINUS_SERVER; jj++) + testSet.client.push_back(testSet.allObjects[jj]); + + // add common data objects to both + for (int jj = SERVER_MINUS_CLIENT + CLIENT_MINUS_SERVER; + jj < SERVER_MINUS_CLIENT + CLIENT_MINUS_SERVER + SIMILAR; jj++) { + testSet.client.push_back(testSet.allObjects[jj]); + testSet.server.push_back(testSet.allObjects[jj]); + } + + } + +private: + + // Both A and B are empty sets + static void addEmptySets(vector &allDataSet) { + vector> res; + multiset recon; + Dataset testData; + testData.desc = "empty sets"; + allDataSet.push_back(testData); + } + + // A is empty, B is not + // B is empty, A is not + static void + addOneEmptySet(vector &allDataSet) { + auto CLIENT_MINUS_SERVER = + static_cast (rand() % UCHAR_MAX) + 1; + Dataset testData, testData2; + testData.desc = "server empty set"; + + getUniqueElements(0, 0, CLIENT_MINUS_SERVER, testData); + allDataSet.push_back(testData); + + testData2.desc = "server empty set"; + getUniqueElements(0, CLIENT_MINUS_SERVER, 0, testData2); + allDataSet.push_back(testData2); + } + + + // A is subset B + // B is subset A + static void addSubsetData(vector &allDataSet) { + Dataset testData; + testData.desc = "subset sets"; + auto SIMILAR = static_cast (rand() % UCHAR_MAX) + 1; + auto CLIENT_MINUS_SERVER = + static_cast (rand() % UCHAR_MAX) + 1; + + getUniqueElements(SIMILAR, 0, CLIENT_MINUS_SERVER, testData); + + allDataSet.push_back(testData); + + } + + // A intersection B is non-empty set but A - B is a huge set + // A intersection B is non-empty set but B - A is a huge set + static void addBigDiffData(vector &allDataSet) { + Dataset testData; + testData.desc = "big diff sets"; + const unsigned int CLIENT_MINUS_SERVER = static_cast (rand() % UCHAR_MAX) + 1; + const unsigned int SERVER_MINUS_CLIENT = static_cast (rand() % UCHAR_MAX) + 1; + const unsigned int SIMILAR = static_cast (rand() % SCHAR_MAX) + 1; // smaller than the two above + + getUniqueElements(SIMILAR, SERVER_MINUS_CLIENT, CLIENT_MINUS_SERVER, testData); + allDataSet.push_back(testData); + } + + // A and B have no intersection and both are huge sets + static void addHugeDiffData(vector &allDataSet) { + Dataset testData; + testData.desc = "huge diff sets"; + + const unsigned int CLIENT_MINUS_SERVER = static_cast (rand() % UCHAR_MAX) + 1 ; + const unsigned int SERVER_MINUS_CLIENT = static_cast (rand() % UCHAR_MAX) + 1; + const unsigned int SIMILAR = 0; + + getUniqueElements(SIMILAR, SERVER_MINUS_CLIENT, CLIENT_MINUS_SERVER, testData); + allDataSet.push_back(testData); + } + + // A and B are exactly equal but non-empty + static void addEqualData(vector &allDataSet) { + Dataset testData; + testData.desc = "equal data sets"; + const unsigned int SIMILAR = static_cast (rand() % UCHAR_MAX) + UCHAR_MAX; + + getUniqueElements(SIMILAR, 0, 0, testData); + allDataSet.push_back(testData); + } + + // A and B have multiset data + static void addMultisetData(vector &allDataSet) { + const unsigned int CLIENT_MINUS_SERVER = static_cast (rand() % UCHAR_MAX) + 1; + const unsigned int SERVER_MINUS_CLIENT = static_cast (rand() % UCHAR_MAX) + 1; + const unsigned int SIMILAR = static_cast (rand() % UCHAR_MAX) + 1; + + Dataset testData; + testData.desc = "multiset data"; + getMultisetElements(SIMILAR, SERVER_MINUS_CLIENT, CLIENT_MINUS_SERVER, testData); + + allDataSet.push_back(testData); + } + + // A and B have large unique data sets + static void addLargeData(vector &allDataSet) { + Dataset testData; + testData.desc = "large data sets"; + const unsigned int SIMILAR = static_cast (rand() % _largeLimit) + 1 ; + const unsigned int CLIENT_MINUS_SERVER = static_cast (rand() % _largeLimit) + 1 ; + const unsigned int SERVER_MINUS_CLIENT = static_cast (rand() % _largeLimit) + 1 ; + + getUniqueElements(SIMILAR, SERVER_MINUS_CLIENT, CLIENT_MINUS_SERVER, testData); + + allDataSet.push_back(testData); + } + +}; + + +#endif //CPISYNC_DATASETGENERATOR_H diff --git a/tests/TestAuxiliary.h b/tests/TestAuxiliary.h index 820436c..1b13e1d 100644 --- a/tests/TestAuxiliary.h +++ b/tests/TestAuxiliary.h @@ -16,6 +16,7 @@ #include #include #include +#include "DatasetGenerator.h" #ifndef CPISYNCLIB_GENERIC_SYNC_TESTS_H #define CPISYNCLIB_GENERIC_SYNC_TESTS_H @@ -23,10 +24,10 @@ // constants const int NUM_TESTS = 1; // Times to run oneWay and twoWay sync tests -const size_t eltSizeSq = (size_t) pow((double) sizeof(randZZ()), 2.0); // Size^2 of elements stored in sync tests -const size_t eltSize = sizeof(randZZ()); // Size of elements stored in sync tests in bytes +const size_t eltSize = DatasetGenerator::_eltSize; +const size_t eltSizeSq = (size_t) pow((double) eltSize, 2.0); // Size^2 of elements stored in sync tests const int mBar = 2 * UCHAR_MAX; // Max differences between client and server in sync tests -const size_t largeLimit = static_cast(pow(2, 9)); // Max number of elements for *each* SIMILAR, CLIENT_MINUS_SERVER and SEVER_MINUS_CLIENT in largeSync +const size_t largeLimit = DatasetGenerator::_largeLimit; const int mBarLarge = largeLimit * 2; // Maximum sum of CLIENT_MINUS_SERVER and SEVER_MINUS_CLIENT const int partitions = 5; //The "arity" of the ptree in InterCPISync if it needs to recurse to complete the sync const string iostr; // Initial string used to construct CommString @@ -400,7 +401,7 @@ inline bool checkServerSuccess(multiset &resServer, multiset &re * @return true iff server reconciliation check is successful, false otherwise */ inline bool -checkServerSucceeded(multiset &resultantServer, multiset &reconciled, bool setofSets, bool oneWay, +checkServerSucceeded(multiset &resultantServer, const multiset &reconciled, bool setofSets, bool oneWay, forkHandleReport &serverReport) { if (!setofSets) { @@ -426,7 +427,7 @@ checkServerSucceeded(multiset &resultantServer, multiset &reconc * @return true iff client reconciliation check is successful, false otherwise */ inline bool -checkClientSucceeded(multiset &resultantClient, multiset &initialClient, multiset &reconciled, +checkClientSucceeded(multiset &resultantClient, multiset &initialClient, const multiset &reconciled, bool setofSets, bool oneWay, forkHandleReport &clientReport) { if (!oneWay) { // reconciliation conditions are same for client and server in two way sync @@ -459,9 +460,7 @@ checkClientSucceeded(multiset &resultantClient, multiset &initia * @return true if reconciliation succeeded, false otherwise */ inline bool createForkForTest(GenSync& GenSyncClient, GenSync& GenSyncServer,bool oneWay, bool probSync,bool syncParamTest, - const unsigned int SIMILAR,const unsigned int CLIENT_MINUS_SERVER, - const unsigned int SERVER_MINUS_CLIENT, multiset reconciled, - bool setofSets){ + const multiset &reconciled, bool setofSets){ int child_state; int my_opt = 0; @@ -686,7 +685,7 @@ inline vector> addElements(bool Multiset, const long SIMI { if (dataSet.size() == pow(2, eltSize * 8)) { - string errorMsg = "Attempting to add more elements to a set than can bre represented by " + toStr(eltSize) + " bytes"; + string errorMsg = "Attempting to add more elements to a set than can be represented by " + toStr(eltSize) + " bytes"; Logger::error_and_quit(errorMsg); } data = rep(random_ZZ_p()); @@ -895,36 +894,45 @@ inline void addElemsSetofSets(GenSync &GenSyncServer, * @return True if *every* recon test appears to be successful (and, if syncParamTest==true, reports that it is successful) and false otherwise. */ inline bool syncTest(GenSync &GenSyncClient, GenSync &GenSyncServer, bool oneWay, bool probSync, bool syncParamTest, - bool Multiset,bool largeSync){ + bool Multiset, bool largeSync){ //Seed test so that changing other tests does not cause failure in tests with a small probability of failure //Don't seed oneWay tests because they loop on the outside of syncTest and you want different values for each run if(!oneWay) srand(3721); bool success = true; + //If one way, run 1 time, if not run NUM_TESTS times for(int ii = 0 ; ii < (oneWay ? 1 : NUM_TESTS); ii++) { - const unsigned int SIMILAR = static_cast - (largeSync ? (rand() % largeLimit) + 1 : (rand() % UCHAR_MAX) + 1); // amt of elems common to both GenSyncs (!= 0) - const unsigned int CLIENT_MINUS_SERVER = static_cast - (largeSync ? (rand() % largeLimit) + 1 : (rand() % UCHAR_MAX) + 1); // amt of elems unique to client (!= 0) - const unsigned int SERVER_MINUS_CLIENT = static_cast - (largeSync ? (rand() % largeLimit) + 1 : (rand() % UCHAR_MAX) + 1); // amt of elems unique to server (!= 0) + vector dataList = DatasetGenerator::generate(Multiset, largeSync); + for ( auto testData : dataList) { + bool thisTestSuccess = true; + // add elements to server, client + DatasetGenerator::addElements(GenSyncClient, GenSyncServer, testData); + + //Returns a boolean value for the success of the synchronization + thisTestSuccess &= createForkForTest(GenSyncClient, GenSyncServer, oneWay, probSync, syncParamTest, + testData.reconciled, false); + + // Remove all elements from GenSyncs and clear dynamically allocated memory for reuse + thisTestSuccess &= GenSyncServer.clearData(); + thisTestSuccess &= GenSyncClient.clearData(); + testData.allObjects.clear(); + + if (!thisTestSuccess) { + Logger::gLog(Logger::TEST, "test fail type: " + testData.desc + + ", client size: " + toStr(testData.client.size()) + + ", server size: " + toStr(testData.server.size())); + } + + success &= thisTestSuccess; + + } - multiset reconciled; - - // add elements to server, client and reconciled - auto objectsPtr = addElements(Multiset,SIMILAR,SERVER_MINUS_CLIENT,CLIENT_MINUS_SERVER,GenSyncServer,GenSyncClient,reconciled); - //Returns a boolean value for the success of the synchronization - success &= createForkForTest(GenSyncClient, GenSyncServer, oneWay, probSync, syncParamTest, SIMILAR, - CLIENT_MINUS_SERVER,SERVER_MINUS_CLIENT, reconciled,false); //Remove all elements from GenSyncs and clear dynamically allocated memory for reuse success &= GenSyncServer.clearData(); success &= GenSyncClient.clearData(); - //Memory is deallocated here because these are shared_ptrs and are deleted when the last ptr to an object is deleted - objectsPtr.clear(); - reconciled.clear(); } return success; // returns success status of tests } @@ -937,25 +945,28 @@ inline bool benchmarkSync(GenSync GenSyncClient, GenSync GenSyncServer, int SIMI int SERVER_MINUS_CLIENT, bool probSync, bool Multiset){ bool success = true; - - multiset reconciled; - auto objectsPtr = addElements(Multiset,SIMILAR,SERVER_MINUS_CLIENT,CLIENT_MINUS_SERVER,GenSyncServer,GenSyncClient,reconciled); + DatasetGenerator::Dataset testData; + DatasetGenerator::getUniqueElements(SIMILAR, SERVER_MINUS_CLIENT, CLIENT_MINUS_SERVER, + testData); + DatasetGenerator::addElements(GenSyncClient, GenSyncServer, testData); //Returns a boolean value for the success of the synchronization - success &= syncTestForkHandle(GenSyncClient, GenSyncServer, false, probSync, false, SIMILAR, - CLIENT_MINUS_SERVER,SERVER_MINUS_CLIENT, reconciled,false); + success &= syncTestForkHandle(GenSyncClient, GenSyncServer, false, probSync, false, + SIMILAR, + CLIENT_MINUS_SERVER, SERVER_MINUS_CLIENT, + testData.reconciled, false); //Remove all elements from GenSyncs and clear dynamically allocated memory for reuse success &= GenSyncServer.clearData(); success &= GenSyncClient.clearData(); //Memory is deallocated here because these are shared_ptrs and are deleted when the last ptr to an object is deleted - objectsPtr.clear(); - reconciled.clear(); + testData.allObjects.clear(); + testData.reconciled.clear(); return success; // returns success status of tests } -/** Sync test for IBLT set of sets funciton +/** Sync test for IBLT set of sets function * @param GenSyncClient the client object * @param GenSyncServer the server object * @param numPerSet upper bound for # of elements in a child set @@ -1037,9 +1048,18 @@ inline bool longTermSync(GenSync &GenSyncClient, bool serverReconcileSuccess = true, clientReconcileSuccess = true; long curRound = 0; - multiset reconciled; + DatasetGenerator::Dataset testData; + if (!Multiset) { + DatasetGenerator::getUniqueElements(SIMILAR, SERVER_MINUS_CLIENT, + CLIENT_MINUS_SERVER, + testData, Rounds, difPerRound); + } else { + DatasetGenerator::getMultisetElements(SIMILAR, SERVER_MINUS_CLIENT, + CLIENT_MINUS_SERVER, testData); + } - auto objectsPtr = addElements(Multiset,SIMILAR,SERVER_MINUS_CLIENT,CLIENT_MINUS_SERVER,GenSyncServer,GenSyncClient,reconciled,Rounds,difPerRound); + DatasetGenerator::addElements(GenSyncClient, GenSyncServer, testData); + multiset reconciled = testData.reconciled; const long refillIndex = reconciled.size(); @@ -1066,8 +1086,8 @@ inline bool longTermSync(GenSync &GenSyncClient, for (int ii = 0; ii < difPerRound; ii++) { - GenSyncServer.addElem(objectsPtr[refillIndex + (curRound - 1) * difPerRound + ii]); - reconciled.insert(objectsPtr[refillIndex + (curRound - 1) * difPerRound + ii]->print()); + GenSyncServer.addElem(testData.allObjects[refillIndex + (curRound - 1) * difPerRound + ii]); + reconciled.insert(testData.allObjects[refillIndex + (curRound - 1) * difPerRound + ii]->print()); } // waiting for start signal from server side @@ -1141,8 +1161,8 @@ inline bool longTermSync(GenSync &GenSyncClient, // add more elements to client for (int ii = 0; ii < difPerRound; ii++) { - GenSyncClient.addElem(objectsPtr[refillIndex + (curRound - 1) * difPerRound + ii]); - reconciled.insert(objectsPtr[refillIndex + (curRound - 1) * difPerRound + ii]->print()); + GenSyncClient.addElem(testData.allObjects[refillIndex + (curRound - 1) * difPerRound + ii]); + reconciled.insert(testData.allObjects[refillIndex + (curRound - 1) * difPerRound + ii]->print()); } } @@ -1219,7 +1239,7 @@ inline bool longTermSync(GenSync &GenSyncClient, { // clear dynamically allocated memory for reuse serverReconcileSuccess &= GenSyncServer.clearData() && GenSyncClient.clearData(); - objectsPtr.clear(); + testData.allObjects.clear(); return serverReconcileSuccess; } diff --git a/tests/unit/CuckooSyncTest.cpp b/tests/unit/CuckooSyncTest.cpp index ca4352e..eb19baf 100644 --- a/tests/unit/CuckooSyncTest.cpp +++ b/tests/unit/CuckooSyncTest.cpp @@ -27,7 +27,7 @@ void CuckooSyncTest::setReconcileTest() { const size_t bits = sizeof(randZZ()); const size_t fngprtSize = 12; const size_t bucketSize = 4; - const size_t filterSize = UCHAR_MAX + 1; // UCHAR_MAX is taken from syncTest + const size_t filterSize = 512 * (UCHAR_MAX + 1); const size_t maxKicks = 500; GenSync server = GenSync::Builder()