Skip to content
  • George Kadianakis's avatar
    Fix test prob distr parameters that caused warnings. · a7199946
    George Kadianakis authored and Nick Mathewson's avatar Nick Mathewson committed
    They were causing the following warnings in circuitpadding/circuitpadding_sample_distribution:
    
         src/lib/math/prob_distr.c:1311:17: runtime error: division by zero
         SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/lib/math/prob_distr.c:1311:17 in
         src/lib/math/prob_distr.c:1219:49: runtime error: division by zero
         SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/lib/math/prob_distr.c:1219:49 in
    
    because the distributions were called with erroneous parameters (e.g. geometric
    distribution with p=0).
    
    We now defined these test probability distributions with more realistic
    parameters.
    
    As far as the circuitpadding_sample_distribution() test is concerned, it
    doesn't matter if the distributions return values outside of [0,10] since we
    already restrict the values into that interval using min=0 and max=10 (and RTT
    estimate is disabled).
    a7199946