Skip to content

Commit 4150c41

Browse files
committed
Fix a few string conversions
1 parent 8d4bbb7 commit 4150c41

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/test_coverage.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function runtests(;virtualhost="/", host="localhost", port=AMQPClient.AMQP_DEFAU
4848
# rabbitmq 3.6.5 does not support qos
4949
# basic_qos(chan1, 1024*10, 10, false)
5050

51-
M = Message(convert(Vector{UInt8}, "hello world"), content_type="text/plain", delivery_mode=PERSISTENT)
51+
M = Message(codeunits("hello world"), content_type="text/plain", delivery_mode=PERSISTENT)
5252

5353
testlog("testing basic publish and get...")
5454
# publish 10 messages
@@ -68,7 +68,7 @@ function runtests(;virtualhost="/", host="localhost", port=AMQPClient.AMQP_DEFAU
6868
@test rcvd_msg.routing_key == ROUTE1
6969
@test rcvd_msg.data == M.data
7070
@test :content_type in keys(rcvd_msg.properties)
71-
@test convert(String, rcvd_msg.properties[:content_type]) == "text/plain"
71+
@test String(rcvd_msg.properties[:content_type]) == "text/plain"
7272
end
7373

7474
# basic get returns null if no more messages

test/test_rpc.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function test_rpc_client(;virtualhost="/", host="localhost", port=AMQPClient.AMQ
5050
# publish NRPC_MSGS messages to the queue
5151
while correlation_id < NRPC_MSGS
5252
correlation_id += 1
53-
M = Message(convert(Vector{UInt8}, "hello from " * queue_name), content_type="text/plain", delivery_mode=PERSISTENT, reply_to=queue_name, correlation_id=string(correlation_id))
53+
M = Message(codeunits("hello from " * queue_name), content_type="text/plain", delivery_mode=PERSISTENT, reply_to=queue_name, correlation_id=string(correlation_id))
5454
basic_publish(chan1, M; exchange=default_exchange_name(), routing_key=QUEUE_RPC)
5555
# sleep a random time between 1 and 5 seconds between requests
5656
sleep(rand())
@@ -110,13 +110,13 @@ function test_rpc_server(;virtualhost="/", host="localhost", port=AMQPClient.AMQ
110110
rpc_count += 1
111111

112112
@test :reply_to in keys(rcvd_msg.properties)
113-
reply_to = convert(String, rcvd_msg.properties[:reply_to])
114-
correlation_id = convert(String, rcvd_msg.properties[:correlation_id])
113+
reply_to = String(rcvd_msg.properties[:reply_to])
114+
correlation_id = String(rcvd_msg.properties[:correlation_id])
115115

116116
resp_str = "$(my_server_id) received msg $(rpc_count) - $(reply_to): $(String(rcvd_msg.data))"
117117
println("server ", resp_str)
118118

119-
M = Message(convert(Vector{UInt8}, resp_str), content_type="text/plain", delivery_mode=PERSISTENT, correlation_id=correlation_id)
119+
M = Message(codeunits(resp_str), content_type="text/plain", delivery_mode=PERSISTENT, correlation_id=correlation_id)
120120
basic_publish(chan1, M; exchange=default_exchange_name(), routing_key=reply_to)
121121

122122
basic_ack(chan1, rcvd_msg.delivery_tag)

0 commit comments

Comments
 (0)