[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-scheme] 03/03: cadet/client: Do mutation testing.
From: |
gnunet |
Subject: |
[gnunet-scheme] 03/03: cadet/client: Do mutation testing. |
Date: |
Fri, 26 Aug 2022 13:49:34 +0200 |
This is an automated email from the git hooks/post-receive script.
maxime-devos pushed a commit to branch master
in repository gnunet-scheme.
commit dbbe078348e7809af1ae08fc064b039d9abbbd50
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Fri Aug 26 13:47:53 2022 +0200
cadet/client: Do mutation testing.
Looks like the "data is properly sent in response to acknowledgements,
in-order" test catches various errors.
* gnu/gnunet/cadet/client.scm (reconnect)[control*]{send-channel-stuff!}:
Annotate with mutation testing results.
---
gnu/gnunet/cadet/client.scm | 31 +++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)
diff --git a/gnu/gnunet/cadet/client.scm b/gnu/gnunet/cadet/client.scm
index 0a90df5..e759652 100644
--- a/gnu/gnunet/cadet/client.scm
+++ b/gnu/gnunet/cadet/client.scm
@@ -231,8 +231,6 @@
;; TODO: use priority information, somehow when cancelling a message
;; cancel the corresponding message to be sent to the CADET service
when
;; there is still time, zero-copy networking.
- ;;
- ;; TODO: untested
(let/ec
stop
(define (stop-if-exhausted)
@@ -246,27 +244,48 @@
;; test.
(values)
(stop)))
+ ;; Tested by ‘data is properly sent in response to acknowledgements,
in-order’
+ ;; -- it catches the mutation 'replace 1 by zero' (as a hang)
(define (decrement!)
(set-channel-allow-send! channel
(- (channel-allow-send channel) 1)))
;; It is important to check that a message can be sent before
;; send! is called, otherwise the message will be removed from
;; the message queue and be forgotten without being ever sent.
+ ;;
+ ;; Tested by ‘data is not sent before an acknowledgement’ -- it
catches
+ ;; the mutation 'remove this line' (as a hang).
(stop-if-exhausted)
(define (send! envelope)
(attempt-irrevocable-sent!
envelope
((go message priority)
- (send-message! mq
+ ;; The mutation ‘don't call send-message!’ is caught by
+ ;; ‘data is properly sent in response to acknowledgements,
in-order’
+ ;; as a hang and an exception.
+ ;;
+ ;; The mutation 'swap send-message!' and 'decrement!' is
uncaught,
+ ;; but theoretically harmless.
+ (send-message! mq ; TODO: maybe get rid of the message queue
limit in (gnu gnunet mq)
(construct-local-data
- (channel-channel-number channel)
+ (channel-channel-number channel) ; TODO:
multiple channels is untested
0 ;; TODO: relation between priority and
priority-preference?
- message))
+ message)) ; TODO: sending the _right_ message is
untested
+ ;; The mutation ‘don't call decrement!' is caught by
+ ;; ‘data is properly sent in response to acknowledgements,
in-order’,
+ ;; as a hang with an exception.
(decrement!))
- ((cancelled) (values))
+ ((cancelled) (values)) ; TODO: untested
((already-sent) (error "tried to send an envelope twice
(CADET)")))
;; Exit once nothing can be sent anymore (TODO check if
;; make-one-by-one-sender allows non-local exits).
+ ;;
+ ;; The mutation 'don't call it' is caught by
+ ;; ‘data is properly sent in response to acknowledgements,
in-order’
+ ;; as a hang and an exception?
+ ;;
+ ;; The mutation 'duplicate it' is uncaught, but theoretically
harmless
+ ;; albeit inefficient.
(stop-if-exhausted))
((make-one-by-one-sender send!) (channel-message-queue channel))))
(match message
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.