<commit_before>/*
 * File:    mocklib.h
 * Author:  <NAME>
 * Brief:   Mock library public API.
 *
 * Date:    27.07.2017
 */

#ifndef _MOCKLIB_H_
#define _MOCKLIB_H_

enum
{
    /*
     * Call count is updated
     * No argument check
     * Always the same value returned
     */
    MOCKLIB_MODE_BASIC,

    /*
     * Call count is updated
     * Arguments checked for every call
     * Other value returned for every call
     */
    MOCKLIB_MODE_TRACE,
};

typedef int32_t mocklib_mode_t;
typedef int32_t mocklib_funtype_t;
typedef struct expfun_record * mocklib_expdata_t;

void mocklib_init(void);
mocklib_expdata_t mocklib_exp_get(void);
void mocklib_exp_set(mocklib_expdata_t exp);
void mocklib_exp_all_called(void);

#endif /* _MOCKLIB_H_ */<commit_msg>lib: update documentation for mocklib.<commit_after>/*
 * File:    mocklib.h
 * Author:  <NAME>
 * Brief:   Mock library public API.
 *
 * Date:    27.07.2017
 */

#ifndef _MOCKLIB_H_
#define _MOCKLIB_H_

enum
{
    /*
     * Call count is updated
     * No argument check
     * Always the same value returned
     */
    MOCKLIB_MODE_BASIC,

    /*
     * Call count is updated
     * Arguments checked for every call
     * Other value returned for every call
     */
    MOCKLIB_MODE_TRACE,
};

/** Type for mocklib mode - available modes in enum. */
typedef int32_t mocklib_mode_t;

/** Type for mocked function type - all mocked functions labels are in enum */
typedef int32_t mocklib_funtype_t;

/** Type for expected function data - storing return value and expected parameters. */
typedef struct expfun_record * mocklib_expdata_t;

/**
 * Initialize mock library to work.
 *
 * This function initializes library internal data and cleans up any existing
 * resources if found.
 */
void mocklib_init(void);

/**
 * Get data of function expected to be called next.
 *
 * When all expected function data already given - function causes test to fail.
 *
 * @return                  Expected function data.
 */
mocklib_expdata_t mocklib_exp_get(void);

/**
 * Add new expected function data to call stack.
 *
 * This function causes test to fail in following cases:
 * - Invalid input argument.
 * - Expected function data internal queue already full.
 *
 * @param exp               Expected function data.
 */
void mocklib_exp_set(mocklib_expdata_t exp);

/**
 * Check if all expected functions were called.
 *
 * Function causes test to fail if not all function data get from internal queue.
 */
void mocklib_exp_all_called(void);

#endif /* _MOCKLIB_H_ */
{'fraction_non_alphanumeric': 0.08161648177496038, 'fraction_numerical': 0.009508716323296355, 'mean_word_length': 3.092382495948136, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6560272', 'n_tokens_mistral': 813, 'n_tokens_neox': 775, 'n_words': 266}