File tree Expand file tree Collapse file tree 3 files changed +32
-21
lines changed Expand file tree Collapse file tree 3 files changed +32
-21
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ mod test_del_publisher;
6
6
mod test_init_mapping;
7
7
mod test_init_price;
8
8
mod test_set_min_pub;
9
+ mod test_sizes;
9
10
mod test_upd_aggregate;
10
11
mod test_upd_price;
11
12
mod test_upd_price_no_fail_on_error;
Original file line number Diff line number Diff line change
1
+ use crate :: c_oracle_header:: {
2
+ pc_map_table_t,
3
+ pc_price_comp_t,
4
+ pc_price_info_t,
5
+ pc_price_t,
6
+ pc_pub_key_t,
7
+ PC_COMP_SIZE ,
8
+ PC_MAP_TABLE_SIZE ,
9
+ } ;
10
+ use std:: mem:: size_of;
11
+
12
+ #[ test]
13
+ fn test_sizes ( ) {
14
+ assert_eq ! ( size_of:: <pc_pub_key_t>( ) , 32 ) ;
15
+ assert_eq ! (
16
+ size_of:: <pc_map_table_t>( ) ,
17
+ 24 + ( PC_MAP_TABLE_SIZE as usize + 1 ) * size_of:: <pc_pub_key_t>( )
18
+ ) ;
19
+ assert_eq ! ( size_of:: <pc_price_info_t>( ) , 32 ) ;
20
+ assert_eq ! (
21
+ size_of:: <pc_price_comp_t>( ) ,
22
+ size_of:: <pc_pub_key_t>( ) + 2 * size_of:: <pc_price_info_t>( )
23
+ ) ;
24
+ assert_eq ! (
25
+ size_of:: <pc_price_t>( ) ,
26
+ 48 + 8 * size_of:: <u64 >( )
27
+ + 3 * size_of:: <pc_pub_key_t>( )
28
+ + size_of:: <pc_price_info_t>( )
29
+ + ( PC_COMP_SIZE as usize ) * size_of:: <pc_price_comp_t>( )
30
+ ) ;
31
+ }
You can’t perform that action at this time.
0 commit comments