@@ -151,6 +151,8 @@ int32_t test_standard_ops(aby_ops_t* test_ops, ABYParty* party, uint32_t bitlen,
151151 vector<Sharing*>& sharings = party->GetSharings ();
152152 Circuit *bc, *yc, *ac;
153153
154+ if (quiet) {std::cout << " Running operation test quietly." << std::endl;}
155+
154156 for (uint32_t r = 0 ; r < num_test_runs; r++) {
155157 for (uint32_t i = 0 ; i < nops; i++) {
156158 Circuit* circ = sharings[test_ops[i].sharing ]->GetCircuitBuildRoutine ();
@@ -286,8 +288,7 @@ int32_t test_standard_ops(aby_ops_t* test_ops, ABYParty* party, uint32_t bitlen,
286288 shrout = circ->PutOUTGate (shrres, ALL);
287289
288290 if (!quiet){
289- std::cout << " Running test no. " << i << " on operation " << test_ops[i].opname ;
290- std::cout << std::endl;
291+ std::cout << " Running test no. " << i << " on operation " << test_ops[i].opname << std::endl;
291292 }
292293
293294 party->ExecCircuit ();
@@ -299,8 +300,13 @@ int32_t test_standard_ops(aby_ops_t* test_ops, ABYParty* party, uint32_t bitlen,
299300 }
300301 party->Reset ();
301302
302- if (!ignore_verification){
303- assert (verify == c);
303+ if (!ignore_verification) {
304+ if (verify != c) {
305+ std::cerr << " ERROR in test verification! " << std::endl;
306+ std::cerr << get_role_name (role) << " " << test_ops[i].opname << " : values: a = " << a
307+ << " , b = " << b << " , c = " << c << " , verify = " << verify << std::endl;
308+ exit (EXIT_FAILURE);
309+ }
304310 }
305311 }
306312 }
@@ -550,24 +556,31 @@ int32_t test_vector_ops(aby_ops_t* test_ops, ABYParty* party, uint32_t bitlen, u
550556
551557 party->Reset ();
552558 for (uint32_t j = 0 ; j < nvals; j++) {
553- if (!quiet)
559+ if (!quiet){
554560 std::cout << " \t " << get_role_name (role) << " " << test_ops[i].opname << " : values[" << j <<
555561 " ]: a = " << avec[j] << " , b = " << bvec[j] << " , c = " << cvec[j] << " , verify = " <<
556562 verifyvec[j] << std::endl;
563+ }
557564 if (!ignore_verification){
558- assert (verifyvec[j] == cvec[j]);
565+ if (verifyvec[j] != cvec[j]){
566+ std::cerr << " ERROR in test verification! " << std::endl;
567+ std::cerr << " \t " << get_role_name (role) << " " << test_ops[i].opname << " : values[" << j <<
568+ " ]: a = " << avec[j] << " , b = " << bvec[j] << " , c = " << cvec[j] << " , verify = " <<
569+ verifyvec[j] << std::endl;
570+ exit (EXIT_FAILURE);
571+ }
559572 }
560-
573+
561574 }
562- free (cvec);
575+ std:: free (cvec);
563576 }
564577 }
565578
566- free (sa);
567- free (sb);
568- free (avec);
569- free (bvec);
570- free (verifyvec);
579+ std:: free (sa);
580+ std:: free (sb);
581+ std:: free (avec);
582+ std:: free (bvec);
583+ std:: free (verifyvec);
571584
572585 return EXIT_SUCCESS;
573586
@@ -614,6 +627,3 @@ int32_t read_test_options(int32_t* argcp, char*** argvp, e_role* role, uint32_t*
614627
615628 return EXIT_SUCCESS;
616629}
617-
618-
619-
0 commit comments