Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
18
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
cellframe-sdk
Commits
d211981d
Commit
d211981d
authored
3 years ago
by
Anton Gerasimov
Browse files
Options
Downloads
Patches
Plain Diff
corrected unit test
parent
1dd59f6b
No related branches found
Branches containing commit
No related tags found
1 merge request
!419
Feature 5220
Pipeline
#7619
passed with stage
Stage: analyze
in 4 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dap-sdk/core/include/dap_math_ops.h
+1
-2
1 addition, 2 deletions
dap-sdk/core/include/dap_math_ops.h
dap-sdk/core/test/math/unit_test.cpp
+24
-5
24 additions, 5 deletions
dap-sdk/core/test/math/unit_test.cpp
with
25 additions
and
7 deletions
dap-sdk/core/include/dap_math_ops.h
+
1
−
2
View file @
d211981d
#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
}
}
...
...
This diff is collapsed.
Click to expand it.
dap-sdk/core/test/math/unit_test.cpp
+
24
−
5
View file @
d211981d
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment