
----------- cumulating time, without forget_sum

0 CHECK_RATE_CTRS(0, 0, 0) ok
0 ADD_MILLISECS(100) --> 23000.100
0 CHECK_RATE_CTRS(0, 0, 0) ok
  flag: FALSE -> TRUE
1 CHECK_RATE_CTRS(0, 0, 0) ok
1 ADD_MILLISECS(1) --> 23000.101
1 CHECK_RATE_CTRS(1, 0, 0) ok
1 ADD_MILLISECS(99) --> 23000.200
1 CHECK_RATE_CTRS(1, 0, 0) ok
  flag: TRUE -> FALSE
0 CHECK_RATE_CTRS(1, 0, 0) ok
0 ADD_MILLISECS(100) --> 23000.300
0 CHECK_RATE_CTRS(1, 0, 0) ok
  flag: FALSE -> TRUE
1 CHECK_RATE_CTRS(1, 0, 0) ok
1 ADD_MILLISECS(100) --> 23000.400
1 CHECK_RATE_CTRS(1, 0, 0) ok
  flag: TRUE -> FALSE
0 CHECK_RATE_CTRS(1, 0, 0) ok
0 ADD_MILLISECS(300) --> 23000.700
0 CHECK_RATE_CTRS(1, 0, 0) ok
  flag: FALSE -> TRUE
1 CHECK_RATE_CTRS(1, 0, 0) ok
1 ADD_MILLISECS(299) --> 23000.999
1 CHECK_RATE_CTRS(1, 0, 0) ok
1 ADD_MILLISECS(1) --> 23001.000
1 CHECK_RATE_CTRS(1, 1, 0) ok
1 ADD_MILLISECS(499) --> 23001.499
1 CHECK_RATE_CTRS(1, 1, 0) ok
1 ADD_MILLISECS(1) --> 23001.500
1 CHECK_RATE_CTRS(1, 1, 1) ok
1 ADD_MILLISECS(1) --> 23001.501
1 CHECK_RATE_CTRS(2, 1, 1) ok
1 ADD_MILLISECS(299) --> 23001.800
1 CHECK_RATE_CTRS(2, 1, 1) ok
  flag: TRUE -> FALSE
0 CHECK_RATE_CTRS(2, 1, 1) ok
0 ADD_MILLISECS(400) --> 23002.200
0 CHECK_RATE_CTRS(2, 1, 1) ok
  flag: FALSE -> TRUE
1 CHECK_RATE_CTRS(2, 1, 1) ok
1 ADD_MILLISECS(199) --> 23002.399
1 CHECK_RATE_CTRS(2, 1, 1) ok
1 ADD_MILLISECS(2) --> 23002.401
1 CHECK_RATE_CTRS(2, 2, 1) ok
1 ADD_MILLISECS(498) --> 23002.899
1 CHECK_RATE_CTRS(2, 2, 1) ok
1 ADD_MILLISECS(2) --> 23002.901
1 CHECK_RATE_CTRS(3, 2, 2) ok
1 ADD_MILLISECS(500) --> 23003.401
1 CHECK_RATE_CTRS(3, 3, 2) ok
1 ADD_MILLISECS(498) --> 23003.899
1 CHECK_RATE_CTRS(3, 3, 2) ok
1 ADD_MILLISECS(3) --> 23003.902
1 CHECK_RATE_CTRS(4, 3, 3) ok
1 ADD_MILLISECS(200) --> 23004.102
1 CHECK_RATE_CTRS(4, 3, 3) ok
  flag: TRUE -> FALSE
0 CHECK_RATE_CTRS(4, 3, 3) ok
0 ADD_MILLISECS(4321) --> 23008.423
0 CHECK_RATE_CTRS(4, 3, 3) ok
  flag: FALSE -> TRUE
1 CHECK_RATE_CTRS(4, 3, 3) ok
1 ADD_MILLISECS(5678) --> 23014.101
1 CHECK_RATE_CTRS(9, 9, 8) ok
  flag: TRUE -> FALSE
0 CHECK_RATE_CTRS(9, 9, 8) ok

----------- test forget_sum_usec

0 CHECK_RATE_CTRS(0, 0, 0) ok
  flag: FALSE -> TRUE
1 CHECK_RATE_CTRS(0, 0, 0) ok
1 ADD_MILLISECS(100) --> 23000.100
1 CHECK_RATE_CTRS(1, 0, 0) ok
  flag: TRUE -> FALSE
0 CHECK_RATE_CTRS(1, 0, 0) ok
0 ADD_MILLISECS(1000) --> 23001.100
0 CHECK_RATE_CTRS(1, 0, 0) ok
0 ADD_MILLISECS(8999) --> 23010.099
0 CHECK_RATE_CTRS(1, 0, 0) ok
0 ADD_MILLISECS(1) --> 23010.100
0 CHECK_RATE_CTRS(1, 0, 0) ok
  flag: FALSE -> TRUE
1 CHECK_RATE_CTRS(1, 0, 0) ok
1 ADD_MILLISECS(1) --> 23010.101
1 CHECK_RATE_CTRS(2, 0, 0) ok
1 ADD_MILLISECS(399) --> 23010.500
1 CHECK_RATE_CTRS(2, 0, 0) ok
1 ADD_MILLISECS(99) --> 23010.599
1 CHECK_RATE_CTRS(2, 0, 0) ok
1 ADD_MILLISECS(1) --> 23010.600
1 CHECK_RATE_CTRS(2, 1, 0) ok
1 ADD_MILLISECS(400) --> 23011.000
1 CHECK_RATE_CTRS(2, 1, 0) ok
1 ADD_MILLISECS(99) --> 23011.099
1 CHECK_RATE_CTRS(2, 1, 0) ok
1 ADD_MILLISECS(1) --> 23011.100
1 CHECK_RATE_CTRS(2, 1, 1) ok
1 ADD_MILLISECS(300) --> 23011.400
1 CHECK_RATE_CTRS(3, 1, 1) ok
  flag: TRUE -> FALSE
0 ADD_MILLISECS(9999) --> 23021.399
  flag: FALSE -> TRUE
1 ADD_MILLISECS(25) --> 23021.424
  flag: TRUE -> FALSE
0 ADD_MILLISECS(9999) --> 23031.423
  flag: FALSE -> TRUE
1 ADD_MILLISECS(25) --> 23031.448
  flag: TRUE -> FALSE
0 ADD_MILLISECS(9999) --> 23041.447
  flag: FALSE -> TRUE
1 ADD_MILLISECS(25) --> 23041.472
  flag: TRUE -> FALSE
0 ADD_MILLISECS(9999) --> 23051.471
  flag: FALSE -> TRUE
1 ADD_MILLISECS(25) --> 23051.496
1 CHECK_RATE_CTRS(3, 1, 1) ok
1 ADD_MILLISECS(100) --> 23051.596
1 CHECK_RATE_CTRS(3, 2, 1) ok
1 ADD_MILLISECS(500) --> 23052.096
1 CHECK_RATE_CTRS(3, 2, 2) ok
1 ADD_MILLISECS(300) --> 23052.396
1 CHECK_RATE_CTRS(4, 2, 2) ok
  flag: TRUE -> FALSE
0 ADD_MILLISECS(5000) --> 23057.396
  flag: FALSE -> FALSE
0 ADD_MILLISECS(5000) --> 23062.396
0 CHECK_RATE_CTRS(4, 2, 2) ok
  flag: FALSE -> TRUE
1 ADD_MILLISECS(1) --> 23062.397
1 CHECK_RATE_CTRS(5, 2, 2) ok
1 ADD_MILLISECS(199) --> 23062.596
1 CHECK_RATE_CTRS(5, 2, 2) ok
1 ADD_MILLISECS(299) --> 23062.895
1 CHECK_RATE_CTRS(5, 2, 2) ok
1 ADD_MILLISECS(1) --> 23062.896
1 CHECK_RATE_CTRS(5, 3, 2) ok
1 ADD_MILLISECS(200) --> 23063.096
1 CHECK_RATE_CTRS(5, 3, 2) ok
1 ADD_MILLISECS(299) --> 23063.395
1 CHECK_RATE_CTRS(5, 3, 2) ok
1 ADD_MILLISECS(1) --> 23063.396
1 CHECK_RATE_CTRS(5, 3, 3) ok

----------- cumulating time, without forget_sum, when timer cb are invoked late

0 CHECK_RATE_CTRS(0, 0, 0) ok
0 ADD_MILLISECS(100) --> 23000.100
0 CHECK_RATE_CTRS(0, 0, 0) ok
  flag: FALSE -> TRUE
1 CHECK_RATE_CTRS(0, 0, 0) ok
1 ADD_MILLISECS(100) --> 23000.200
1 CHECK_RATE_CTRS(1, 0, 0) ok
  flag: TRUE -> FALSE
0 CHECK_RATE_CTRS(1, 0, 0) ok
0 ADD_MILLISECS(100) --> 23000.300
0 CHECK_RATE_CTRS(1, 0, 0) ok
  flag: FALSE -> TRUE
1 CHECK_RATE_CTRS(1, 0, 0) ok
1 ADD_MILLISECS(100) --> 23000.400
1 CHECK_RATE_CTRS(1, 0, 0) ok
  flag: TRUE -> FALSE
0 CHECK_RATE_CTRS(1, 0, 0) ok
0 ADD_MILLISECS(300) --> 23000.700
0 CHECK_RATE_CTRS(1, 0, 0) ok
  flag: FALSE -> TRUE
1 CHECK_RATE_CTRS(1, 0, 0) ok
1 ADD_MILLISECS(799) --> 23001.499
1 CHECK_RATE_CTRS(1, 1, 0) ok
1 ADD_MILLISECS(1) --> 23001.500
1 CHECK_RATE_CTRS(1, 1, 1) ok
1 ADD_MILLISECS(300) --> 23001.800
1 CHECK_RATE_CTRS(2, 1, 1) ok
  flag: TRUE -> FALSE
0 CHECK_RATE_CTRS(2, 1, 1) ok
0 ADD_MILLISECS(400) --> 23002.200
0 CHECK_RATE_CTRS(2, 1, 1) ok
  flag: FALSE -> TRUE
1 CHECK_RATE_CTRS(2, 1, 1) ok
1 ADD_MILLISECS(699) --> 23002.899
1 CHECK_RATE_CTRS(2, 2, 1) ok
1 ADD_MILLISECS(1) --> 23002.900
1 CHECK_RATE_CTRS(2, 2, 2) ok
1 ADD_MILLISECS(1) --> 23002.901
1 CHECK_RATE_CTRS(3, 2, 2) ok
1 ADD_MILLISECS(499) --> 23003.400
1 CHECK_RATE_CTRS(3, 3, 2) ok
1 ADD_MILLISECS(499) --> 23003.899
1 CHECK_RATE_CTRS(3, 3, 2) ok
1 ADD_MILLISECS(1) --> 23003.900
1 CHECK_RATE_CTRS(3, 3, 3) ok
1 ADD_MILLISECS(200) --> 23004.100
1 CHECK_RATE_CTRS(4, 3, 3) ok
  flag: TRUE -> FALSE
0 CHECK_RATE_CTRS(4, 3, 3) ok
0 ADD_MILLISECS(4321) --> 23008.421
0 CHECK_RATE_CTRS(4, 3, 3) ok
  flag: FALSE -> TRUE
1 CHECK_RATE_CTRS(4, 3, 3) ok
1 ADD_MILLISECS(5678) --> 23014.099
1 CHECK_RATE_CTRS(9, 9, 8) ok
  flag: TRUE -> FALSE
0 CHECK_RATE_CTRS(9, 9, 8) ok

----------- test forget_sum, when timer cb are invoked late

0 CHECK_RATE_CTRS(0, 0, 0) ok
  flag: FALSE -> TRUE
1 CHECK_RATE_CTRS(0, 0, 0) ok
1 ADD_MILLISECS(100) --> 23000.100
1 CHECK_RATE_CTRS(1, 0, 0) ok
  flag: TRUE -> FALSE
0 CHECK_RATE_CTRS(1, 0, 0) ok
0 ADD_MILLISECS(1000) --> 23001.100
0 CHECK_RATE_CTRS(1, 0, 0) ok
0 ADD_MILLISECS(8999) --> 23010.099
0 CHECK_RATE_CTRS(1, 0, 0) ok
0 ADD_MILLISECS(1) --> 23010.100
0 CHECK_RATE_CTRS(1, 0, 0) ok
  flag: FALSE -> TRUE
1 CHECK_RATE_CTRS(1, 0, 0) ok
1 ADD_MILLISECS(1) --> 23010.101
1 CHECK_RATE_CTRS(2, 0, 0) ok
1 ADD_MILLISECS(399) --> 23010.500
1 CHECK_RATE_CTRS(2, 0, 0) ok
1 ADD_MILLISECS(99) --> 23010.599
1 CHECK_RATE_CTRS(2, 0, 0) ok
1 ADD_MILLISECS(1) --> 23010.600
1 CHECK_RATE_CTRS(2, 1, 0) ok
1 ADD_MILLISECS(400) --> 23011.000
1 CHECK_RATE_CTRS(2, 1, 0) ok
1 ADD_MILLISECS(99) --> 23011.099
1 CHECK_RATE_CTRS(2, 1, 0) ok
1 ADD_MILLISECS(1) --> 23011.100
1 CHECK_RATE_CTRS(2, 1, 1) ok
1 ADD_MILLISECS(300) --> 23011.400
1 CHECK_RATE_CTRS(3, 1, 1) ok
  flag: TRUE -> FALSE
0 ADD_MILLISECS(9999) --> 23021.399
  flag: FALSE -> TRUE
1 ADD_MILLISECS(25) --> 23021.424
  flag: TRUE -> FALSE
0 ADD_MILLISECS(9999) --> 23031.423
  flag: FALSE -> TRUE
1 ADD_MILLISECS(25) --> 23031.448
  flag: TRUE -> FALSE
0 ADD_MILLISECS(9999) --> 23041.447
  flag: FALSE -> TRUE
1 ADD_MILLISECS(25) --> 23041.472
  flag: TRUE -> FALSE
0 ADD_MILLISECS(9999) --> 23051.471
  flag: FALSE -> TRUE
1 ADD_MILLISECS(25) --> 23051.496
1 CHECK_RATE_CTRS(3, 1, 1) ok
1 ADD_MILLISECS(100) --> 23051.596
1 CHECK_RATE_CTRS(3, 2, 1) ok
1 ADD_MILLISECS(500) --> 23052.096
1 CHECK_RATE_CTRS(3, 2, 2) ok

----------- test T_defs

T_defs: T_gran=100000usec T_round_threshold=10000usec T_forget_sum=0usec
0 CHECK_RATE_CTRS(0, 0, 0) ok
0 ADD_MILLISECS(100) --> 23000.100
0 CHECK_RATE_CTRS(0, 0, 0) ok
  flag: FALSE -> TRUE
1 CHECK_RATE_CTRS(0, 0, 0) ok
1 ADD_MILLISECS(9) --> 23000.109
1 CHECK_RATE_CTRS(1, 0, 0) ok
1 ADD_MILLISECS(1) --> 23000.110
1 CHECK_RATE_CTRS(1, 1, 0) ok
1 ADD_MILLISECS(90) --> 23000.200
1 CHECK_RATE_CTRS(1, 1, 1) ok
T_defs: T_gran=200000usec T_round_threshold=190000usec T_forget_sum=1000000usec
1 CHECK_RATE_CTRS(1, 1, 1) ok
1 ADD_MILLISECS(1) --> 23000.201
1 CHECK_RATE_CTRS(1, 1, 1) ok
1 ADD_MILLISECS(1) --> 23000.202
1 CHECK_RATE_CTRS(2, 1, 1) ok
1 ADD_MILLISECS(8) --> 23000.210
1 CHECK_RATE_CTRS(2, 1, 1) ok
1 ADD_MILLISECS(90) --> 23000.300
1 CHECK_RATE_CTRS(2, 1, 1) ok
1 ADD_MILLISECS(99) --> 23000.399
1 CHECK_RATE_CTRS(2, 1, 1) ok
1 ADD_MILLISECS(1) --> 23000.400
1 CHECK_RATE_CTRS(2, 2, 1) ok
1 ADD_MILLISECS(1) --> 23000.401
1 CHECK_RATE_CTRS(2, 2, 1) ok
1 ADD_MILLISECS(1) --> 23000.402
1 CHECK_RATE_CTRS(3, 2, 1) ok
1 ADD_MILLISECS(98) --> 23000.500
1 CHECK_RATE_CTRS(3, 2, 2) ok
1 ADD_MILLISECS(99) --> 23000.599
1 CHECK_RATE_CTRS(3, 2, 2) ok
1 ADD_MILLISECS(1) --> 23000.600
1 CHECK_RATE_CTRS(3, 3, 2) ok
1 ADD_MILLISECS(1) --> 23000.601
1 CHECK_RATE_CTRS(3, 3, 2) ok
1 ADD_MILLISECS(1) --> 23000.602
1 CHECK_RATE_CTRS(4, 3, 2) ok
1 ADD_MILLISECS(98) --> 23000.700
1 CHECK_RATE_CTRS(4, 3, 3) ok
T_defs: T_gran=100000usec T_round_threshold=0usec T_forget_sum=0usec
1 CHECK_RATE_CTRS(4, 3, 3) ok
1 ADD_MILLISECS(100) --> 23000.800
1 CHECK_RATE_CTRS(4, 3, 3) ok
1 ADD_MILLISECS(2) --> 23000.802
1 CHECK_RATE_CTRS(4, 3, 3) ok
1 ADD_MILLISECS(1) --> 23000.803
1 CHECK_RATE_CTRS(5, 3, 3) ok
1 ADD_MILLISECS(46) --> 23000.849
1 CHECK_RATE_CTRS(5, 3, 3) ok
1 ADD_MILLISECS(1) --> 23000.850
1 CHECK_RATE_CTRS(5, 4, 3) ok
1 ADD_MILLISECS(50) --> 23000.900
1 ADD_MILLISECS(2) --> 23000.902
1 CHECK_RATE_CTRS(5, 4, 3) ok
1 ADD_MILLISECS(1) --> 23000.903
1 CHECK_RATE_CTRS(6, 4, 3) ok
1 ADD_MILLISECS(46) --> 23000.949
1 CHECK_RATE_CTRS(6, 4, 3) ok
1 ADD_MILLISECS(1) --> 23000.950
1 CHECK_RATE_CTRS(6, 5, 3) ok
