summaryrefslogtreecommitdiff
path: root/src/mock_runtime_test.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-07-06 16:26:34 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-07-06 18:25:09 -0400
commita2dde56c5961f451b9042c1f651af372c4984034 (patch)
tree06aaf64e257d9d6bd1f6f16eca2b02aab971c04b /src/mock_runtime_test.cc
parent9778eceaf5922b1e051859a68b2e02a2f1b1ee8b (diff)
Remove channel parameter from deno_send/recv.
Diffstat (limited to 'src/mock_runtime_test.cc')
-rw-r--r--src/mock_runtime_test.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/mock_runtime_test.cc b/src/mock_runtime_test.cc
index d3d9df2a6..67b097e8d 100644
--- a/src/mock_runtime_test.cc
+++ b/src/mock_runtime_test.cc
@@ -28,7 +28,7 @@ deno_buf strbuf(const char* str) { return deno_buf{str, strlen(str)}; }
TEST(MockRuntimeTest, SendSuccess) {
Deno* d = deno_new(nullptr, nullptr);
EXPECT_TRUE(deno_execute(d, "a.js", "SendSuccess()"));
- EXPECT_TRUE(deno_send(d, "SendSuccess", strbuf("abc")));
+ EXPECT_TRUE(deno_send(d, strbuf("abc")));
deno_delete(d);
}
@@ -36,22 +36,21 @@ TEST(MockRuntimeTest, SendByteLength) {
Deno* d = deno_new(nullptr, nullptr);
EXPECT_TRUE(deno_execute(d, "a.js", "SendByteLength()"));
// We pub the wrong sized message, it should throw.
- EXPECT_FALSE(deno_send(d, "SendByteLength", strbuf("abcd")));
+ EXPECT_FALSE(deno_send(d, strbuf("abcd")));
deno_delete(d);
}
TEST(MockRuntimeTest, SendNoCallback) {
Deno* d = deno_new(nullptr, nullptr);
// We didn't call deno.recv() in JS, should fail.
- EXPECT_FALSE(deno_send(d, "SendNoCallback", strbuf("abc")));
+ EXPECT_FALSE(deno_send(d, strbuf("abc")));
deno_delete(d);
}
TEST(MockRuntimeTest, RecvReturnEmpty) {
static int count = 0;
- Deno* d = deno_new(nullptr, [](auto _, auto channel, auto buf) {
+ Deno* d = deno_new(nullptr, [](auto _, auto buf) {
count++;
- EXPECT_STREQ(channel, "RecvReturnEmpty");
EXPECT_EQ(static_cast<size_t>(3), buf.len);
EXPECT_EQ(buf.data[0], 'a');
EXPECT_EQ(buf.data[1], 'b');
@@ -64,9 +63,8 @@ TEST(MockRuntimeTest, RecvReturnEmpty) {
TEST(MockRuntimeTest, RecvReturnBar) {
static int count = 0;
- Deno* d = deno_new(nullptr, [](auto deno, auto channel, auto buf) {
+ Deno* d = deno_new(nullptr, [](auto deno, auto buf) {
count++;
- EXPECT_STREQ(channel, "RecvReturnBar");
EXPECT_EQ(static_cast<size_t>(3), buf.len);
EXPECT_EQ(buf.data[0], 'a');
EXPECT_EQ(buf.data[1], 'b');
@@ -98,9 +96,8 @@ TEST(MockRuntimeTest, SnapshotBug) {
TEST(MockRuntimeTest, ErrorHandling) {
static int count = 0;
- Deno* d = deno_new(nullptr, [](auto deno, auto channel, auto buf) {
+ Deno* d = deno_new(nullptr, [](auto deno, auto buf) {
count++;
- EXPECT_STREQ(channel, "ErrorHandling");
EXPECT_EQ(static_cast<size_t>(1), buf.len);
EXPECT_EQ(buf.data[0], 42);
});