LCOV - code coverage report
Current view: top level - testing - testing_api_trait_reserve_history.c (source / functions) Hit Total Coverage
Test: GNU Taler exchange coverage report Lines: 5 5 100.0 %
Date: 2021-08-30 06:43:37 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) 2018-2020 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/testing_api_trait_reserve_history.c
      21             :  * @brief implements reserve hostry trait
      22             :  * @author Christian Grothoff
      23             :  */
      24             : #include "platform.h"
      25             : #include "taler_json_lib.h"
      26             : #include <gnunet/gnunet_curl_lib.h>
      27             : #include "taler_signatures.h"
      28             : #include "taler_testing_lib.h"
      29             : 
      30             : #define TALER_TESTING_TRAIT_RESERVE_HISTORY \
      31             :   "reserve-history-entry"
      32             : 
      33             : 
      34             : /**
      35             :  * Obtain a reserve history entry from a @a cmd.
      36             :  *
      37             :  * @param cmd command to extract the reserve history from.
      38             :  * @param index reserve history's index number.
      39             :  * @param[out] rhp set to the reserve history.
      40             :  * @return #GNUNET_OK on success.
      41             :  */
      42             : int
      43          25 : TALER_TESTING_get_trait_reserve_history (
      44             :   const struct TALER_TESTING_Command *cmd,
      45             :   unsigned int index,
      46             :   const struct TALER_EXCHANGE_ReserveHistory **rhp)
      47             : {
      48          25 :   return cmd->traits (cmd->cls,
      49             :                       (const void **) rhp,
      50             :                       TALER_TESTING_TRAIT_RESERVE_HISTORY,
      51             :                       index);
      52             : }
      53             : 
      54             : 
      55             : /**
      56             :  * Offer a reserve history entry.
      57             :  *
      58             :  * @param index reserve pubs's index number.
      59             :  * @param rh reserve history entry to offer.
      60             :  * @return the trait.
      61             :  */
      62             : struct TALER_TESTING_Trait
      63        1587 : TALER_TESTING_make_trait_reserve_history (
      64             :   unsigned int index,
      65             :   const struct TALER_EXCHANGE_ReserveHistory *rh)
      66             : {
      67        1587 :   struct TALER_TESTING_Trait ret = {
      68             :     .index = index,
      69             :     .trait_name = TALER_TESTING_TRAIT_RESERVE_HISTORY,
      70             :     .ptr = (const void *) rh
      71             :   };
      72        1587 :   return ret;
      73             : }
      74             : 
      75             : 
      76             : /* end of testing_api_trait_reserve_history.c */

Generated by: LCOV version 1.14