Skip to content
Snippets Groups Projects
Commit d211981d authored by Anton Gerasimov's avatar Anton Gerasimov
Browse files

corrected unit test

parent 1dd59f6b
No related branches found
No related tags found
1 merge request!419Feature 5220
Pipeline #7619 passed with stage
in 4 seconds
#pragma once #pragma once
#include <stdint.h> #include <stdint.h>
#include "dap_common.h" #include "dap_common.h"
#include <boost/multiprecision/cpp_int.hpp> #include <boost/multiprecision/cpp_int.hpp>
#include <stdint.h> #include <stdint.h>
...@@ -93,7 +92,7 @@ static inline bool dap_unsign128_t_check_equal(unsign128_t a_128_bit, unsign128_ ...@@ -93,7 +92,7 @@ static inline bool dap_unsign128_t_check_equal(unsign128_t a_128_bit, unsign128_
#ifdef DAP_GLOBAL_IS_INT128 #ifdef DAP_GLOBAL_IS_INT128
return a_128_bit == b_128_bit; return a_128_bit == b_128_bit;
#else #else
return a_128_bit.lo==b_128_bit.lo && a_128_bit.hi==b_128_bit; return a_128_bit.lo==b_128_bit.lo && a_128_bit.hi==b_128_bit.hi;
#endif #endif
} }
......
...@@ -39,6 +39,9 @@ int main() ...@@ -39,6 +39,9 @@ int main()
std::ofstream sum_256_256_file; std::ofstream sum_256_256_file;
sum_256_256_file.open ("SUM_256_256.txt"); sum_256_256_file.open ("SUM_256_256.txt");
std::ofstream prod_64_128_file;
prod_64_128_file.open ("PROD_64_128.txt");
uint128_t hi_64{"0xffffffffffffffff0000000000000000"}; uint128_t hi_64{"0xffffffffffffffff0000000000000000"};
uint128_t lo_64{"0x0000000000000000ffffffffffffffff"}; uint128_t lo_64{"0x0000000000000000ffffffffffffffff"};
...@@ -137,7 +140,7 @@ int main() ...@@ -137,7 +140,7 @@ int main()
// //
// if(boost_dap_128_prod_comparison!=boost_test_64_128_prod){ // if(boost_dap_128_prod_comparison!=boost_test_64_128_prod){
// error_counter_prod+=1;} // error_counter_prod+=1;}
//
if(verbose_output==1){ if(verbose_output==1){
...@@ -204,6 +207,22 @@ int main() ...@@ -204,6 +207,22 @@ int main()
sum_256_256_file << (boost_dap_256_comparison)<< std::endl;} sum_256_256_file << (boost_dap_256_comparison)<< std::endl;}
// if(boost_dap_256_comparison!=boost_test_256_sum){
//
// prod_64_128_file << "boost_dap_128_prod_comparison"<< std::endl;
//
// prod_64_128_file << (boost_dap_128_prod_comparison)<< std::endl;
//
// prod_64_128_file << "boost_test_64_128_prod"<< std::endl;
//
// prod_64_128_file << (boost_test_64_128_prod)<< std::endl;
//
//}
//
...@@ -221,10 +240,10 @@ int main() ...@@ -221,10 +240,10 @@ int main()
std::cout<< "SUM_256_256 returns identical results to boost:: 256 bit addition"<< std::endl;} std::cout<< "SUM_256_256 returns identical results to boost:: 256 bit addition"<< std::endl;}
//
if(error_counter_prod==0){ // if(error_counter_prod==0){
//
std::cout<< "SUM_256_256 returns identical results to boost:: 256 bit addition"<< std::endl;} // std::cout<< "SUM_256_256 returns identical results to boost:: 256 bit addition"<< std::endl;}
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment