Skip to content

Commit e6f683c

Browse files
author
chaoqin-li1123
committed
clean up
Signed-off-by: chaoqin-li1123 <[email protected]>
1 parent 09e8a55 commit e6f683c

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

test/wasm_test.cc

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -112,58 +112,4 @@ TEST_P(TestVM, GetOrCreateThreadLocalWasmFailCallbacks) {
112112
ASSERT_NE(thread_local_plugin3->wasm(), thread_local_plugin2->wasm());
113113
}
114114

115-
TEST_P(TestVM, DifferentRootContextsFromDifferentPluginKeys) {
116-
const std::string plugin_name = "plugin_name";
117-
const std::string root_id = "root_id";
118-
const std::string vm_id = "vm_id";
119-
const std::string vm_config = "vm_config";
120-
const std::string plugin_config = "plugin_config";
121-
const bool fail_open = false;
122-
123-
const std::shared_ptr<PluginBase> plugin1 = std::make_shared<PluginBase>(
124-
plugin_name, root_id, vm_id, runtime_, plugin_config, fail_open, "plugin1_key");
125-
126-
// Define callbacks.
127-
WasmHandleFactory wasm_handle_factory =
128-
[this, vm_id, vm_config](std::string_view vm_key) -> std::shared_ptr<WasmHandleBase> {
129-
auto base_wasm = std::make_shared<WasmBase>(newVm(), vm_id, vm_config, vm_key,
130-
std::unordered_map<std::string, std::string>{},
131-
AllowedCapabilitiesMap{});
132-
return std::make_shared<WasmHandleBase>(base_wasm);
133-
};
134-
135-
WasmHandleCloneFactory wasm_handle_clone_factory =
136-
[this](std::shared_ptr<WasmHandleBase> base_wasm_handle) -> std::shared_ptr<WasmHandleBase> {
137-
std::shared_ptr<WasmBase> wasm = std::make_shared<WasmBase>(
138-
base_wasm_handle, [this]() -> std::unique_ptr<WasmVm> { return newVm(); });
139-
return std::make_shared<WasmHandleBase>(wasm);
140-
};
141-
142-
// Read the minimal loadable binary.
143-
std::string source = readTestWasmFile("abi_export.wasm");
144-
145-
const std::string vm_key = "vm_key";
146-
// Create base Wasm via createWasm.
147-
std::shared_ptr<WasmHandleBase> base_wasm_handle =
148-
createWasm(vm_key, source, plugin1, wasm_handle_factory, wasm_handle_clone_factory, false);
149-
base_wasm_handle->wasm()->start(plugin1);
150-
ContextBase *root_context1 = base_wasm_handle->wasm()->getRootContext(plugin1, false);
151-
EXPECT_TRUE(root_context1 != nullptr);
152-
153-
// Create a new plugin with different key.
154-
const std::shared_ptr<PluginBase> plugin2 = std::make_shared<PluginBase>(
155-
plugin_name, root_id, vm_id, runtime_, plugin_config, fail_open, "plugin2_key");
156-
EXPECT_TRUE(base_wasm_handle->wasm()->getRootContext(plugin2, false) == nullptr);
157-
158-
// Create context from a plugin2.
159-
base_wasm_handle->wasm()->start(plugin2);
160-
ContextBase *root_context2 = base_wasm_handle->wasm()->getRootContext(plugin2, false);
161-
EXPECT_TRUE(root_context2 != nullptr);
162-
163-
// Verify that the 2 root contexts are different contexts with the same root id.
164-
EXPECT_TRUE(root_context1->isRootContext() && root_context2->isRootContext());
165-
EXPECT_TRUE(root_context1 != root_context2);
166-
EXPECT_TRUE(root_context1->root_id() == root_context2->root_id());
167-
}
168-
169115
} // namespace proxy_wasm

0 commit comments

Comments
 (0)