gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] branch master updated (bd39d42 -> dbbe078)


From: gnunet
Subject: [gnunet-scheme] branch master updated (bd39d42 -> dbbe078)
Date: Fri, 26 Aug 2022 13:49:31 +0200

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a change to branch master
in repository gnunet-scheme.

    from bd39d42  tests/cadet: Verify that messages are received.
     new bb57353  cadet/client: Remove resolved TODO about channel-allow-send
     new 1ecdb2f  tests/cadet: Remove (pk ...) noise.
     new dbbe078  cadet/client: Do mutation testing.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gnu/gnunet/cadet/client.scm | 33 +++++++++++++++++++++++++--------
 tests/cadet.scm             |  2 +-
 2 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/gnu/gnunet/cadet/client.scm b/gnu/gnunet/cadet/client.scm
index aa9d738..e759652 100644
--- a/gnu/gnunet/cadet/client.scm
+++ b/gnu/gnunet/cadet/client.scm
@@ -132,8 +132,6 @@
              ;; and incremented after receiving a
              ;; @code{/:msg:cadet:local:acknowledgement}.
              ;;
-             ;; TODO: implement
-             ;;
              ;; Concurrency: this may only be read/written in the main event 
loop.
              (mutable allow-send channel-allow-send set-channel-allow-send!))
       (protocol (lambda (%make)
@@ -233,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)
@@ -248,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
diff --git a/tests/cadet.scm b/tests/cadet.scm
index eece218..7247992 100644
--- a/tests/cadet.scm
+++ b/tests/cadet.scm
@@ -158,7 +158,7 @@
   (test-assert testcase
     (quickcheck
      (property ((name $arbitrary) ...)
-              (let^ ((! expected (pk 'e (list name ...)))
+              (let^ ((! expected (list name ...))
                      (! constructed (construct name ...))
                      (<-- analysed (analyse constructed))
                      (! analysed (normalise analysed)))

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]