LCOV - code coverage report
Current view: top level - testing - testing_api_trait_string.c (source / functions) Hit Total Coverage
Test: GNU Taler merchant coverage report Lines: 10 10 100.0 %
Date: 2021-08-30 06:54:17 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :   This file is part of TALER
       3             :   Copyright (C) 2018 Taler Systems SA
       4             : 
       5             :   TALER is free software; you can redistribute it and/or modify
       6             :   it under the terms of the GNU General Public License as
       7             :   published by the Free Software Foundation; either version 3, or
       8             :   (at your 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
      13             :   GNU 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 testing_api_trait_string.c
      21             :  * @brief offer traits that come as strings.
      22             :  * @author Marcello Stanisci
      23             :  */
      24             : #include "platform.h"
      25             : #include <taler/taler_signatures.h>
      26             : #include <taler/taler_exchange_service.h>
      27             : #include <taler/taler_testing_lib.h>
      28             : 
      29             : #define TALER_TESTING_TRAIT_PROPOSAL_REFERENCE "proposal-reference"
      30             : #define TALER_TESTING_TRAIT_COIN_REFERENCE "coin-reference"
      31             : 
      32             : 
      33             : int
      34           8 : TALER_TESTING_get_trait_proposal_reference
      35             :   (const struct TALER_TESTING_Command *cmd,
      36             :   unsigned int index,
      37             :   const char **proposal_reference)
      38             : {
      39           8 :   return cmd->traits (cmd->cls,
      40             :                       (const void **) proposal_reference,
      41             :                       TALER_TESTING_TRAIT_PROPOSAL_REFERENCE,
      42             :                       index);
      43             : }
      44             : 
      45             : 
      46             : struct TALER_TESTING_Trait
      47          38 : TALER_TESTING_make_trait_proposal_reference
      48             :   (unsigned int index,
      49             :   const char *proposal_reference)
      50             : {
      51          38 :   struct TALER_TESTING_Trait ret = {
      52             :     .index = index,
      53             :     .trait_name = TALER_TESTING_TRAIT_PROPOSAL_REFERENCE,
      54             :     .ptr = (const void *) proposal_reference
      55             :   };
      56          38 :   return ret;
      57             : }
      58             : 
      59             : 
      60             : int
      61           7 : TALER_TESTING_get_trait_coin_reference
      62             :   (const struct TALER_TESTING_Command *cmd,
      63             :   unsigned int index,
      64             :   const char **coin_reference)
      65             : {
      66           7 :   return cmd->traits (cmd->cls,
      67             :                       (const void **) coin_reference,
      68             :                       TALER_TESTING_TRAIT_COIN_REFERENCE,
      69             :                       index);
      70             : }
      71             : 
      72             : 
      73             : struct TALER_TESTING_Trait
      74          38 : TALER_TESTING_make_trait_coin_reference
      75             :   (unsigned int index,
      76             :   const char *coin_reference)
      77             : {
      78          38 :   struct TALER_TESTING_Trait ret = {
      79             :     .index = index,
      80             :     .trait_name = TALER_TESTING_TRAIT_COIN_REFERENCE,
      81             :     .ptr = (const void *) coin_reference
      82             :   };
      83          38 :   return ret;
      84             : }
      85             : 
      86             : 
      87             : /* end of testing_api_trait_string.c */

Generated by: LCOV version 1.14