Skip to content

Commit ab3e76b

Browse files
committed
fixup! RCU-based mailbox constructor
1 parent 7b17559 commit ab3e76b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ tests_install:
8686
${MKDIR} ${SCRIPTS_INSTALL_PATH}/tests
8787
${MKDIR} ${SCRIPTS_INSTALL_PATH}/tests/rcumap_sync
8888
${INSTALL} -m 0644 tests/rcumap_sync/*.lua ${SCRIPTS_INSTALL_PATH}/tests/rcumap_sync
89+
${MKDIR} ${SCRIPTS_INSTALL_PATH}/tests/mailbox
90+
${INSTALL} -m 0644 tests/mailbox/*.lua ${SCRIPTS_INSTALL_PATH}/tests/mailbox
8991

9092
tests_uninstall:
9193
${RM} -r ${SCRIPTS_INSTALL_PATH}/tests

tests/mailbox/main.lua

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ function MailboxTests.test_local_inbox_outbox()
4646
assert_is_nil(inbox:receive(0)) -- Should be empty now
4747

4848
-- Test send on inbox (should error)
49-
assert_has_error(function() inbox:send("should fail") end, "receive-only mailbox")
49+
assert_has_error(function() inbox:send("should fail") end, "receive%-only mailbox")
5050

5151
-- Test receive on outbox (should error)
52-
assert_has_error(function() outbox:receive(0) end, "send-only mailbox")
52+
assert_has_error(function() outbox:receive(0) end, "send%-only mailbox")
5353
end
5454

5555
function MailboxTests.test_non_blocking_mailbox()
@@ -163,8 +163,7 @@ local function run_tests()
163163
print("\nRunning Mailbox Tests...")
164164

165165
for name, func in pairs(MailboxTests) do
166-
if type(func) == "function" and string.sub(name, 1, 5) == "test_" then
167-
io.write(" " .. name .. ": ")
166+
print(" " .. name .. ": ")
168167
local ok, err = pcall(func)
169168
if ok then
170169
print("PASS")
@@ -173,7 +172,6 @@ local function run_tests()
173172
print("FAIL - " .. err)
174173
num_failed = num_failed + 1
175174
end
176-
end
177175
end
178176

179177
print(string.format("\nTests finished: %d passed, %d failed", num_passed, num_failed))

0 commit comments

Comments
 (0)