gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] 05/13: modified truth trait


From: gnunet
Subject: [taler-anastasis] 05/13: modified truth trait
Date: Sun, 03 May 2020 18:02:29 +0200

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

dennis-neufeld pushed a commit to branch master
in repository anastasis.

commit b1fe80357901dd794143c4ecd2f936ca01b53700
Author: Dennis Neufeld <address@hidden>
AuthorDate: Fri May 1 18:37:29 2020 +0000

    modified truth trait
---
 src/include/anastasis_testing_lib.h | 27 ------------------------
 src/lib/test_anastasis.c            | 12 +++++------
 src/lib/testing_cmd_truth_upload.c  | 42 ++++---------------------------------
 src/lib/testing_trait_truth.c       | 42 -------------------------------------
 4 files changed, 10 insertions(+), 113 deletions(-)

diff --git a/src/include/anastasis_testing_lib.h 
b/src/include/anastasis_testing_lib.h
index 60ccef8..3fa792d 100644
--- a/src/include/anastasis_testing_lib.h
+++ b/src/include/anastasis_testing_lib.h
@@ -460,33 +460,6 @@ ANASTASIS_TESTING_cmd_salt (const char *label,
 
 /* ********************* test truth upload ********************* */
 
-/**
- * Obtain numbers of truth traits from @a cmd.
- *
- * @param cmd command to extract the number from.
- * @param index the index of the number
- * @param n[out] set to the number coming from @a cmd.
- * @return #GNUNET_OK on success.
- */
-int
-ANASTASIS_TESTING_get_trait_truth_number (const struct
-                                          TALER_TESTING_Command *cmd,
-                                          unsigned int index,
-                                          const unsigned int **n);
-
-
-/**
- * Offer the number of truth traits.
- *
- * @param index the number's index number (usually zero).
- * @param n the number to offer.
- * @return #GNUNET_OK on success.
- */
-struct TALER_TESTING_Trait
-ANASTASIS_TESTING_make_trait_truth_number (unsigned int index,
-                                           const unsigned int *n);
-
-
 /**
  * Obtain a truth from @a cmd.
  *
diff --git a/src/lib/test_anastasis.c b/src/lib/test_anastasis.c
index 7867d14..b3cf89d 100644
--- a/src/lib/test_anastasis.c
+++ b/src/lib/test_anastasis.c
@@ -185,7 +185,7 @@ run (void *cls,
 
   struct TALER_TESTING_Command anastasis[] = {
     // FIXME: testing logic here
-    ANASTASIS_TESTING_cmd_salt ("truth-create-1",
+    ANASTASIS_TESTING_cmd_salt ("salt-request-1",
                                 anastasis_url,
                                 MHD_HTTP_OK),
 
@@ -200,9 +200,9 @@ run (void *cls,
                                         strlen ("HashOfSomeTruth"),
                                         MHD_HTTP_NO_CONTENT,
                                         ANASTASIS_TESTING_TSO_NONE,
-                                        NULL),
+                                        "salt-request-1"),
 
-    ANASTASIS_TESTING_cmd_salt ("truth-create-2",
+    ANASTASIS_TESTING_cmd_salt ("salt-request-2",
                                 anastasis_url,
                                 MHD_HTTP_OK),
 
@@ -217,9 +217,9 @@ run (void *cls,
                                         strlen ("HashOfSomeTruth"),
                                         MHD_HTTP_NO_CONTENT,
                                         ANASTASIS_TESTING_TSO_NONE,
-                                        "truth-create-1"),
+                                        "salt-request-2"),
 
-    ANASTASIS_TESTING_cmd_salt ("truth-create-3",
+    ANASTASIS_TESTING_cmd_salt ("salt-request-3",
                                 anastasis_url,
                                 MHD_HTTP_OK),
 
@@ -234,7 +234,7 @@ run (void *cls,
                                         strlen ("HashOfSomeTruth"),
                                         MHD_HTTP_NO_CONTENT,
                                         ANASTASIS_TESTING_TSO_NONE,
-                                        "truth-create-2"),
+                                        "salt-request-3"),
     /*
     ANASTASIS_TESTING_cmd_secret_share ("secret-share-1",
                                         anastasis_url,
diff --git a/src/lib/testing_cmd_truth_upload.c 
b/src/lib/testing_cmd_truth_upload.c
index e6eb6a2..1a5f577 100644
--- a/src/lib/testing_cmd_truth_upload.c
+++ b/src/lib/testing_cmd_truth_upload.c
@@ -107,11 +107,6 @@ struct TruthUploadState
    * Truth object
    */
   const struct ANASTASIS_Truth *truth;
-
-  /**
-   * index of truth (for trait)
-   */
-  unsigned int truth_number;
 };
 
 
@@ -188,42 +183,15 @@ truth_upload_run (void *cls,
       TALER_TESTING_interpreter_fail (tus->is);
       return;
     }
-    const unsigned int *number;
-
     if (GNUNET_OK !=
-        ANASTASIS_TESTING_get_trait_truth_number (ref,
-                                                  0,
-                                                  &number))
+        ANASTASIS_TESTING_get_trait_salt (ref,
+                                          0,
+                                          &salt))
     {
       GNUNET_break (0);
       TALER_TESTING_interpreter_fail (tus->is);
       return;
     }
-    tus->truth_number = *number + 1;
-  }
-  else
-  {
-    tus->truth_number = 0;
-  }
-
-  ref = TALER_TESTING_interpreter_lookup_command
-          (is,
-          tus->label);
-  if (NULL == ref)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (tus->is);
-    return;
-  }
-
-  if (GNUNET_OK !=
-      ANASTASIS_TESTING_get_trait_salt (ref,
-                                        0,
-                                        &salt))
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (tus->is);
-    return;
   }
 
   tus->tuo = ANASTASIS_truth_upload (is->ctx,
@@ -294,10 +262,8 @@ truth_upload_traits (void *cls,
 {
   struct TruthUploadState *tus = cls;
   struct TALER_TESTING_Trait traits[] = {
-    ANASTASIS_TESTING_make_trait_truth (tus->truth_number,
+    ANASTASIS_TESTING_make_trait_truth (0,
                                         tus->truth),
-    ANASTASIS_TESTING_make_trait_truth_number (0,
-                                               &tus->truth_number),
     TALER_TESTING_trait_end ()
   };
 
diff --git a/src/lib/testing_trait_truth.c b/src/lib/testing_trait_truth.c
index 2ed45a2..1088484 100644
--- a/src/lib/testing_trait_truth.c
+++ b/src/lib/testing_trait_truth.c
@@ -27,48 +27,6 @@
 #include "anastasis_testing_lib.h"
 
 #define ANASTASIS_TESTING_TRAIT_TRUTH "anastasis-truth"
-#define ANASTASIS_TESTING_TRAIT_TRUTH_NUMBER "anastasis-truth-number"
-
-/**
- * Obtain numbers of truth traits from @a cmd.
- *
- * @param cmd command to extract the number from.
- * @param index the index of the number
- * @param n[out] set to the number coming from @a cmd.
- * @return #GNUNET_OK on success.
- */
-int
-ANASTASIS_TESTING_get_trait_truth_number (const struct
-                                          TALER_TESTING_Command *cmd,
-                                          unsigned int index,
-                                          const unsigned int **n)
-{
-  return cmd->traits (cmd->cls,
-                      (const void **) n,
-                      ANASTASIS_TESTING_TRAIT_TRUTH_NUMBER,
-                      index);
-}
-
-
-/**
- * Offer the number of truth traits.
- *
- * @param index the number's index number (usually zero).
- * @param n the number to offer.
- * @return #GNUNET_OK on success.
- */
-struct TALER_TESTING_Trait
-ANASTASIS_TESTING_make_trait_truth_number
-  (unsigned int index,
-  const unsigned int *n)
-{
-  struct TALER_TESTING_Trait ret = {
-    .index = index,
-    .trait_name = ANASTASIS_TESTING_TRAIT_TRUTH_NUMBER,
-    .ptr = (const void *) n
-  };
-  return ret;
-}
 
 
 /**

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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