summaryrefslogtreecommitdiff
path: root/cesar/bufmgr/test/utest/inc/scenario_defs.h
blob: eb80cd69846c6814d16e6ba9945a8c792169d2fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef inc_scenario_defs_h
#define inc_scenario_defs_h
/* Cesar project {{{
 *
 * Copyright (C) 2012 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    inc/scenario_defs.h
 * \brief   Scenario entries definition.
 * \ingroup test
 */
#include "bufmgr/bufmgr.h"

/* Scenario globals. */
#define SCENARIO_DEFS_GLOBALS \
    bufmgr_t *bufmgr;

/* Scenario actions. */
#define SCENARIO_DEFS_ACTIONS \
    bufmgr_fill_cache, \
    bufmgr_get, \
    bufmgr_get_wait, \
    bufmgr_give_back, \
    bufmgr_keep_buffer

typedef struct
{
    uint ipmbox_buf_available;
} scenario_action_bufmgr_fill_cache_t;

void
scenario_action_bufmgr_fill_cache_cb (scenario_globals_t *globals,
                                      scenario_params_t *params);

typedef struct
{
    u8 *buf_expected;
} scenario_action_bufmgr_get_t;

void
scenario_action_bufmgr_get_cb (scenario_globals_t *globals,
                               scenario_params_t *params);

typedef scenario_action_bufmgr_get_t scenario_action_bufmgr_get_wait_t;

void
scenario_action_bufmgr_get_wait_cb (scenario_globals_t *globals,
                                    scenario_params_t *params);

typedef struct
{
    u8 *buffer;
} scenario_action_bufmgr_keep_buffer_t;

void
scenario_action_bufmgr_keep_buffer_cb(scenario_globals_t *globals,
                                      scenario_params_t *params);

typedef scenario_empty_t scenario_action_bufmgr_give_back_t;

void
scenario_action_bufmgr_give_back_cb (scenario_globals_t *globals,
                                     scenario_params_t *params);

/* Scenario events. */
#define SCENARIO_DEFS_EVENTS \
    ipmbox_empty_buf_get, \
    ipmbox_tx_empty_buf

typedef struct
{
    uint nb_req;
    uint nb_return;
} scenario_event_ipmbox_empty_buf_get_t;

typedef struct
{
    uint length;
} scenario_event_ipmbox_tx_empty_buf_t;

#endif /* inc_scenario_defs_h */