Skip to content

Commit 065da3f

Browse files
author
chaoqin-li1123
committed
share queue test
Signed-off-by: chaoqin-li1123 <[email protected]>
1 parent 94d5438 commit 065da3f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/wasm_test.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,15 @@ TEST_P(WasmTest, SharedQueueProducerConsumer) {
182182
EXPECT_EQ(root_context2->lookupSharedQueue(vm_id_, queue_name, &token2), WasmResult::Ok);
183183
EXPECT_EQ(token1, token2);
184184
for (int i = 0; i < 5; i++) {
185-
root_context1->enqueueSharedQueue(token1, std::to_string(i));
185+
EXPECT_EQ(root_context1->enqueueSharedQueue(token1, std::to_string(i)), WasmResult::Ok);
186186
}
187187
std::string data;
188188
for (int i = 0; i < 5; i++) {
189-
root_context1->dequeueSharedQueue(token1, &data);
189+
EXPECT_EQ(root_context2->dequeueSharedQueue(token1, &data), WasmResult::Ok);
190190
EXPECT_EQ(data, std::to_string(i));
191191
}
192+
EXPECT_EQ(root_context2->dequeueSharedQueue(token1, &data), WasmResult::Empty);
193+
EXPECT_EQ(root_context2->dequeueSharedQueue(10086, &data), WasmResult::NotFound);
192194
}
193195

194196
} // namespace proxy_wasm

0 commit comments

Comments
 (0)