We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 081592f commit 0a9f119Copy full SHA for 0a9f119
test/runtests.jl
@@ -214,6 +214,27 @@ end
214
@test did_callback2
215
end
216
217
+@testset "lcm_handle allocations" begin
218
+ data = UInt8[1,2,3,4,5]
219
+ channel = "CHANNEL_1"
220
+
221
+ # start listening
222
+ sublcm = LCM()
223
+ sub = subscribe(sublcm, channel, (c, d) -> nothing)
224
+ set_queue_capacity(sub, 2)
225
226
+ # publish two messages
227
+ publcm = LCM()
228
+ for _ = 1 : 2
229
+ publish(publcm, channel, data)
230
+ end
231
232
+ # check that handling doesn't allocate
233
+ LCMCore.lcm_handle(sublcm)
234
+ allocs = @allocated LCMCore.lcm_handle(sublcm)
235
+ @test allocs == 0
236
+end
237
238
include("test_lcmtype.jl")
239
include("test_readlog.jl")
240
0 commit comments