| 7 | using empty_t = std::tuple<>; |
| 8 | |
| 9 | TEST(TypedFunc, Smoke) { |
| 10 | Engine engine; |
| 11 | Store store(engine); |
| 12 | Func thunk( |
| 13 | store, FuncType({}, {}), |
| 14 | [](auto caller, auto params, auto results) { return std::monostate(); }); |
| 15 | |
| 16 | EXPECT_FALSE((thunk.typed<int, int>(store))); |
| 17 | EXPECT_FALSE((thunk.typed<float, std::tuple<int32_t, uint32_t>>(store))); |
| 18 | EXPECT_FALSE((thunk.typed<float, empty_t>(store))); |
| 19 | EXPECT_TRUE((thunk.typed<empty_t, empty_t>(store))); |
| 20 | |
| 21 | Func pi32( |
| 22 | store, FuncType({ValType::i32()}, {}), |
| 23 | [](auto caller, auto params, auto results) { return std::monostate(); }); |
| 24 | |
| 25 | EXPECT_FALSE((pi32.typed<float, empty_t>(store))); |
| 26 | EXPECT_TRUE((pi32.typed<std::tuple<int32_t>, empty_t>(store))); |
| 27 | EXPECT_TRUE((pi32.typed<int32_t, empty_t>(store))); |
| 28 | EXPECT_TRUE((pi32.typed<std::tuple<uint32_t>, empty_t>(store))); |
| 29 | EXPECT_TRUE((pi32.typed<uint32_t, empty_t>(store))); |
| 30 | |
| 31 | Func rets( |
| 32 | store, FuncType({}, {ValType::f32(), ValType::f64()}), |
| 33 | [](auto caller, auto params, auto results) { return std::monostate(); }); |
| 34 | |
| 35 | EXPECT_FALSE((rets.typed<empty_t, std::tuple<int, int>>(store))); |
| 36 | EXPECT_FALSE((rets.typed<empty_t, empty_t>(store))); |
| 37 | EXPECT_TRUE((rets.typed<empty_t, std::tuple<float, double>>(store))); |
| 38 | } |
| 39 | |
| 40 | TEST(TypedFunc, Call) { |
| 41 | Engine engine; |
nothing calls this directly
no test coverage detected