Browse Source

Better presentation for tests, small bug in mkdb-correctness

Carlos Aguilar 8 years ago
parent
commit
ec46fba5cd
2 changed files with 29 additions and 8 deletions
  1. 28 7
      apps/simplepir/simplePIR.cpp
  2. 1 1
      apps/tools/mkdb-correctness.sh

+ 28 - 7
apps/simplepir/simplePIR.cpp

@@ -203,7 +203,10 @@ int main(int argc, char * argv[]) {
   // maxFileBytesize = database_size/nb_files;
   // maxFileBytesize = database_size/nb_files;
 
 
   // Simple test
   // Simple test
-  std::cout << "Test 1/7: database_size = 1ULL<<31; nb_files = 20; params.alpha = 1; params.d = 1;params.crypto_params = LWE:80:2048:120;" << std::endl; 
+  std::cout << "======================================================================" << std::endl;
+  std::cout << "Test 1/7: database_size = 1ULL<<31; nb_files = 20;" << std::endl;
+  std::cout << "params.alpha = 1; params.d = 1; crypto_params = LWE:80:2048:120;" << std::endl; 
+  std::cout << "======================================================================" << std::endl;
   database_size = 1ULL<<31; nb_files = 20; maxFileBytesize = database_size/nb_files;
   database_size = 1ULL<<31; nb_files = 20; maxFileBytesize = database_size/nb_files;
   DBGenerator db(nb_files, maxFileBytesize, /*bool silent*/ false); 
   DBGenerator db(nb_files, maxFileBytesize, /*bool silent*/ false); 
   chosen_element = 3;
   chosen_element = 3;
@@ -217,7 +220,10 @@ int main(int argc, char * argv[]) {
   // Test with aggregation
   // Test with aggregation
   // WARNING we must provide the representation of the database GIVEN recursion and aggregation
   // WARNING we must provide the representation of the database GIVEN recursion and aggregation
   // as here we have 100 elements and aggregate them in a unique group we have params.n[0]=1
   // as here we have 100 elements and aggregate them in a unique group we have params.n[0]=1
-  std::cout << "Test 2/7: database_size = 1ULL<<25; nb_files = 100; params.alpha = 100; params.d = 1;params.crypto_params = LWE:80:2048:120;" << std::endl; 
+  std::cout << "======================================================================" << std::endl;
+  std::cout << "Test 2/7: database_size = 1ULL<<25; nb_files = 100;" << std::endl;
+  std::cout << "params.alpha = 100; params.d = 1; crypto_params = LWE:80:2048:120;" << std::endl; 
+  std::cout << "======================================================================" << std::endl;
   database_size = 1ULL<<25; nb_files = 100; maxFileBytesize = database_size/nb_files;
   database_size = 1ULL<<25; nb_files = 100; maxFileBytesize = database_size/nb_files;
   DBGenerator db2(nb_files, maxFileBytesize, /*bool silent*/ false); 
   DBGenerator db2(nb_files, maxFileBytesize, /*bool silent*/ false); 
   chosen_element = 0;
   chosen_element = 0;
@@ -226,7 +232,10 @@ int main(int argc, char * argv[]) {
   tests_failed |= run(&db2, chosen_element, params);
   tests_failed |= run(&db2, chosen_element, params);
   
   
   // Test with recursion 2
   // Test with recursion 2
-  std::cout << "Test 3/7: database_size = 1ULL<<25; nb_files = 100; params.alpha = 1; params.d = 2;params.crypto_params = LWE:80:2048:120;" << std::endl; 
+  std::cout << "======================================================================" << std::endl;
+  std::cout << "Test 3/7: database_size = 1ULL<<25; nb_files = 100;" << std::endl;
+  std::cout << "params.alpha = 1; params.d = 2; crypto_params = LWE:80:2048:120;" << std::endl; 
+  std::cout << "======================================================================" << std::endl;
   database_size = 1ULL<<25; nb_files = 100; maxFileBytesize = database_size/nb_files;
   database_size = 1ULL<<25; nb_files = 100; maxFileBytesize = database_size/nb_files;
   DBGenerator db3(nb_files, maxFileBytesize, /*bool silent*/ false); 
   DBGenerator db3(nb_files, maxFileBytesize, /*bool silent*/ false); 
   chosen_element = 3;
   chosen_element = 3;
@@ -235,7 +244,10 @@ int main(int argc, char * argv[]) {
   tests_failed |= run(&db3, chosen_element, params);
   tests_failed |= run(&db3, chosen_element, params);
   
   
   // Test with recursion 2 and aggregation
   // Test with recursion 2 and aggregation
-  std::cout << "Test 4/7: database_size = 1ULL<<25; nb_files = 100; params.alpha = 2; params.d = 2;params.crypto_params = LWE:80:2048:120;" << std::endl; 
+  std::cout << "======================================================================" << std::endl;
+  std::cout << "Test 4/7: database_size = 1ULL<<25; nb_files = 100;" << std::endl;
+  std::cout << "params.alpha = 2; params.d = 2; crypto_params = LWE:80:2048:120;" << std::endl; 
+  std::cout << "======================================================================" << std::endl;
   database_size = 1ULL<<25; nb_files = 100; maxFileBytesize = database_size/nb_files;
   database_size = 1ULL<<25; nb_files = 100; maxFileBytesize = database_size/nb_files;
   DBGenerator db4(nb_files, maxFileBytesize, /*bool silent*/ false); 
   DBGenerator db4(nb_files, maxFileBytesize, /*bool silent*/ false); 
   chosen_element = 3;
   chosen_element = 3;
@@ -244,7 +256,10 @@ int main(int argc, char * argv[]) {
   tests_failed |= run(&db4, chosen_element, params);
   tests_failed |= run(&db4, chosen_element, params);
   
   
   // Test with recursion 3
   // Test with recursion 3
-  std::cout << "Test 5/7: database_size = 1ULL<<25; nb_files = 100; params.alpha = 1; params.d = 3;params.crypto_params = LWE:80:2048:120;" << std::endl; 
+  std::cout << "======================================================================" << std::endl;
+  std::cout << "Test 5/7: database_size = 1ULL<<25; nb_files = 100;" << std::endl;
+  std::cout << "params.alpha = 1; params.d = 3; crypto_params = LWE:80:2048:120;" << std::endl; 
+  std::cout << "======================================================================" << std::endl;
   database_size = 1ULL<<25; nb_files = 100; maxFileBytesize = database_size/nb_files;
   database_size = 1ULL<<25; nb_files = 100; maxFileBytesize = database_size/nb_files;
   DBGenerator db5(nb_files, maxFileBytesize, /*bool silent*/ false); 
   DBGenerator db5(nb_files, maxFileBytesize, /*bool silent*/ false); 
   chosen_element = 3;
   chosen_element = 3;
@@ -253,7 +268,10 @@ int main(int argc, char * argv[]) {
   tests_failed |= run(&db5, chosen_element, params);
   tests_failed |= run(&db5, chosen_element, params);
   
   
   // Test with a DBDirectoryProcessor splitting a big real file
   // Test with a DBDirectoryProcessor splitting a big real file
-  std::cout << "Test 6/7: DBDirectoryProcessor with split; database_size = 1ULL<<25; nb_files = 4; params.alpha = 1; params.d = 1;params.crypto_params = LWE:80:2048:120;" << std::endl; 
+  std::cout << "======================================================================" << std::endl;
+  std::cout << "Test 6/7: DBDirectoryProcessor with split; database_size = 1ULL<<25; nb_files = 4;" << std::endl;
+  std::cout << "params.alpha = 1; params.d = 1; crypto_params = LWE:80:2048:120;" << std::endl; 
+  std::cout << "======================================================================" << std::endl;
   database_size = 1ULL<<25; nb_files = 4; maxFileBytesize = database_size/nb_files;
   database_size = 1ULL<<25; nb_files = 4; maxFileBytesize = database_size/nb_files;
   DBDirectoryProcessor db6(/*split the bit file in*/ nb_files /*files*/);
   DBDirectoryProcessor db6(/*split the bit file in*/ nb_files /*files*/);
   chosen_element = 3;
   chosen_element = 3;
@@ -262,7 +280,10 @@ int main(int argc, char * argv[]) {
   tests_failed |= run(&db6, chosen_element, params);
   tests_failed |= run(&db6, chosen_element, params);
   
   
   // Test with a DBDirectoryProcessor reading real files
   // Test with a DBDirectoryProcessor reading real files
-  std::cout << "Test 7/7: DBDirectoryProcessor without split; params.alpha = 1; params.d = 1;params.crypto_params = LWE:80:2048:120;" << std::endl; 
+  std::cout << "======================================================================" << std::endl;
+  std::cout << "Test 7/7: DBDirectoryProcessor without split;" << std::endl;
+  std::cout << "params.alpha = 1; params.d = 1; crypto_params = LWE:80:2048:120;" << std::endl; 
+  std::cout << "======================================================================" << std::endl;
   DBDirectoryProcessor db7;
   DBDirectoryProcessor db7;
   database_size = db7.getDBSizeBits()/8; nb_files = db7.getNbStream(); 
   database_size = db7.getDBSizeBits()/8; nb_files = db7.getNbStream(); 
   maxFileBytesize = database_size/nb_files;
   maxFileBytesize = database_size/nb_files;

+ 1 - 1
apps/tools/mkdb-correctness.sh

@@ -31,7 +31,7 @@ if [[ -e check.repo ]]
 then
 then
   echo "Check repo exists, not rebuilding it"
   echo "Check repo exists, not rebuilding it"
   echo "Remove it manually if you want it rebuilt"
   echo "Remove it manually if you want it rebuilt"
-  return
+  exit 
 fi
 fi
 
 
 mkdir check.repo
 mkdir check.repo