blob: 929ca225966dba20fa013e8549a12c23606ae051 [file] [log] [blame]
Andrew Jeffery5ab4e3e2017-04-12 14:23:24 +09301/*
2 * MBox Daemon Test File
3 *
4 * Copyright 2017 IBM
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20#ifndef TEST_MBOX_H
21#define TEST_MBOX_H
22
23#include <stddef.h>
24#include <stdint.h>
25
26#include "../common.h"
27#include "../mbox.h"
28
29#include "tmpf.h"
30
31struct mbox_context *mbox_create_test_context(int n_windows, size_t len);
32
33int mbox_set_mtd_data(struct mbox_context *context, const void *data,
34 size_t len);
35
36void mbox_dump(struct mbox_context *context);
37
38int mbox_cmp(struct mbox_context *context, const uint8_t *expected, size_t len);
39
40int mbox_command_write(struct mbox_context *context, const uint8_t *command,
41 size_t len);
42
43int mbox_command_dispatch(struct mbox_context *context, const uint8_t *command,
44 size_t len);
45
46/* Helpers */
Andrew Jefferyee7af882018-03-01 11:57:50 +103047void dump_buf(const void *buf, size_t len);
Andrew Jeffery5ab4e3e2017-04-12 14:23:24 +093048
49#endif /* TEST_MBOX_H */