/src/WasmEdge/include/host/mock/wasmedge_image_func.h
Line | Count | Source (jump to first uncovered line) |
1 | | // SPDX-License-Identifier: Apache-2.0 |
2 | | // SPDX-FileCopyrightText: 2019-2024 Second State INC |
3 | | |
4 | | #pragma once |
5 | | |
6 | | #include "common/errcode.h" |
7 | | #include "host/mock/log.h" |
8 | | #include "runtime/callingframe.h" |
9 | | #include "runtime/hostfunc.h" |
10 | | |
11 | | namespace WasmEdge { |
12 | | namespace Host { |
13 | | namespace WasmEdgeImageMock { |
14 | | |
15 | | using namespace std::literals; |
16 | | static inline constexpr const uint32_t kWasmEdgeImageError = 1U; |
17 | | |
18 | | class LoadJPG : public Runtime::HostFunction<LoadJPG> { |
19 | | public: |
20 | | Expect<uint32_t> body(const Runtime::CallingFrame &, uint32_t, uint32_t, |
21 | 0 | uint32_t, uint32_t, uint32_t, uint32_t, uint32_t) { |
22 | 0 | printPluginMock("WasmEdge-Image"sv); |
23 | 0 | return kWasmEdgeImageError; |
24 | 0 | } |
25 | | }; |
26 | | |
27 | | class LoadPNG : public Runtime::HostFunction<LoadPNG> { |
28 | | public: |
29 | | Expect<uint32_t> body(const Runtime::CallingFrame &, uint32_t, uint32_t, |
30 | 0 | uint32_t, uint32_t, uint32_t, uint32_t, uint32_t) { |
31 | 0 | printPluginMock("WasmEdge-Image"sv); |
32 | 0 | return kWasmEdgeImageError; |
33 | 0 | } |
34 | | }; |
35 | | |
36 | | class LoadImage : public Runtime::HostFunction<LoadImage> { |
37 | | public: |
38 | | Expect<uint32_t> body(const Runtime::CallingFrame &, uint32_t, uint32_t, |
39 | 0 | uint32_t, uint32_t, uint32_t, uint32_t, uint32_t) { |
40 | 0 | printPluginMock("WasmEdge-Image"sv); |
41 | 0 | return kWasmEdgeImageError; |
42 | 0 | } |
43 | | }; |
44 | | |
45 | | } // namespace WasmEdgeImageMock |
46 | | } // namespace Host |
47 | | } // namespace WasmEdge |