LCOV - code coverage report
Current view: top level - testing - testing_trait_challenge.c (source / functions) Hit Total Coverage
Test: GNU Taler anastasis coverage report Lines: 5 5 100.0 %
Date: 2021-06-16 06:33:01 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :   This file is part of TALER
       3             :   Copyright (C) 2020 Taler Systems SA
       4             : 
       5             :   TALER is free software; you can redistribute it and/or modify it
       6             :   under the terms of the GNU General Public License as published
       7             :   by the Free Software Foundation; either version 3, or (at your
       8             :   option) any later version.
       9             : 
      10             :   TALER is distributed in the hope that it will be useful, but
      11             :   WITHOUT ANY WARRANTY; without even the implied warranty of
      12             :   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      13             :   General Public License for more details.
      14             : 
      15             :   You should have received a copy of the GNU General Public
      16             :   License along with TALER; see the file COPYING.  If not, see
      17             :   <http://www.gnu.org/licenses/>
      18             : */
      19             : /**
      20             :  * @file lib/testing_trait_challenge.c
      21             :  * @brief traits to offer a challenge
      22             :  * @author Christian Grothoff
      23             :  * @author Dominik Meister
      24             :  * @author Dennis Neufeld
      25             :  */
      26             : #include "platform.h"
      27             : #include "anastasis_testing_lib.h"
      28             : 
      29             : #define ANASTASIS_TESTING_TRAIT_CHALLENGE "anastasis-challenge"
      30             : 
      31             : /**
      32             :  * Obtain a challenge from @a cmd.
      33             :  *
      34             :  * @param cmd command to extract the challenge from.
      35             :  * @param index the index of the challenge
      36             :  * @param c[out] set to the challenge coming from @a cmd.
      37             :  * @return #GNUNET_OK on success.
      38             :  */
      39             : int
      40           4 : ANASTASIS_TESTING_get_trait_challenge (const struct TALER_TESTING_Command *cmd,
      41             :                                        unsigned int index,
      42             :                                        const struct ANASTASIS_Challenge **c)
      43             : {
      44           4 :   return cmd->traits (cmd->cls,
      45             :                       (const void **) c,
      46             :                       ANASTASIS_TESTING_TRAIT_CHALLENGE,
      47             :                       index);
      48             : }
      49             : 
      50             : 
      51             : /**
      52             :  * Offer a challenge.
      53             :  *
      54             :  * @param index the challenge index number.
      55             :  * @param c the challenge to offer.
      56             :  * @return #GNUNET_OK on success.
      57             :  */
      58             : struct TALER_TESTING_Trait
      59           4 : ANASTASIS_TESTING_make_trait_challenge
      60             :   (unsigned int index,
      61             :   const struct ANASTASIS_Challenge *c)
      62             : {
      63           4 :   struct TALER_TESTING_Trait ret = {
      64             :     .index = index,
      65             :     .trait_name = ANASTASIS_TESTING_TRAIT_CHALLENGE,
      66             :     .ptr = (const void *) c
      67             :   };
      68           4 :   return ret;
      69             : }
      70             : 
      71             : 
      72             : /* end of testing_trait_challenge.c */

Generated by: LCOV version 1.14