diff options
author | Maxime Devos <maximedevos@telenet.be> | 2021-09-22 20:51:49 +0200 |
---|---|---|
committer | Maxime Devos <maximedevos@telenet.be> | 2021-09-22 20:51:49 +0200 |
commit | 04115082a527413f573c075c5685021b038e81cd (patch) | |
tree | 2e9be03575dddfce7d6625adccbe5492d97b04a3 | |
parent | 97dcd0b885881ed86ef726d1604873fde6f2affa (diff) | |
download | gnunet-scheme-04115082a527413f573c075c5685021b038e81cd.tar.gz gnunet-scheme-04115082a527413f573c075c5685021b038e81cd.zip |
tests/network-size: Verify +nan.0 and +inf.0 are allowed as stddev.
* tests/network-size.scm (%estimates): Add two cases.
* gnu/gnunet/nse/client.scm
(reconnect)[handlers]<msg:nse:estimate>{well-formed?}: Adjust XXX.
-rw-r--r-- | gnu/gnunet/nse/client.scm | 3 | ||||
-rw-r--r-- | tests/network-size.scm | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gnu/gnunet/nse/client.scm b/gnu/gnunet/nse/client.scm index d240c28..3bb1095 100644 --- a/gnu/gnunet/nse/client.scm +++ b/gnu/gnunet/nse/client.scm | |||
@@ -145,7 +145,8 @@ even if not connected. This is an idempotent operation." | |||
145 | ((well-formed? slice) | 145 | ((well-formed? slice) |
146 | (and (= (slice-length slice) | 146 | (and (= (slice-length slice) |
147 | (sizeof /:msg:nse:estimate '())) | 147 | (sizeof /:msg:nse:estimate '())) |
148 | ;; XXX: these two lines below are not tested | 148 | ;; XXX: there is no test verifying these two expressions |
149 | ;; are present | ||
149 | (>= (read% /:msg:nse:estimate '(size-estimate) slice) 0) | 150 | (>= (read% /:msg:nse:estimate '(size-estimate) slice) 0) |
150 | ;; See <https://bugs.gnunet.org/view.php?id=7021#c18399> for | 151 | ;; See <https://bugs.gnunet.org/view.php?id=7021#c18399> for |
151 | ;; situations in which the deviation can be infinite or NaN. | 152 | ;; situations in which the deviation can be infinite or NaN. |
diff --git a/tests/network-size.scm b/tests/network-size.scm index 7ad56d1..1c8d4da 100644 --- a/tests/network-size.scm +++ b/tests/network-size.scm | |||
@@ -77,7 +77,10 @@ | |||
77 | #t)))) | 77 | #t)))) |
78 | 78 | ||
79 | (define %estimates | 79 | (define %estimates |
80 | `((0. ,(expt 2.0 0.) 0.1 0) | 80 | `((0. ,(expt 2.0 0.) 0. 0) ; stddev can theoretically be zero |
81 | (0. ,(expt 2.0 0.) +nan.0 0) ; see <https://bugs.gnunet.org/view.php?id=7021#c18399> | ||
82 | (0. ,(expt 2.0 0.) +inf.0 0) ; likewise | ||
83 | (0. ,(expt 2.0 0.) 0.1 0) | ||
81 | (1. ,(expt 2.0 1.) 0.11 10) | 84 | (1. ,(expt 2.0 1.) 0.11 10) |
82 | (2. ,(expt 2.0 2.) 0.111 100) | 85 | (2. ,(expt 2.0 2.) 0.111 100) |
83 | (3. ,(expt 2.0 3.) 0.1111 1000))) | 86 | (3. ,(expt 2.0 3.) 0.1111 1000))) |