[ntcore] Use full handle when subscribing (#5013)

Just using the index is insufficient because of Subscriber overlap with
MultiSubscriber.
This commit is contained in:
Peter Johnson
2023-01-27 09:14:38 -08:00
committed by GitHub
parent 7cd30cffbc
commit 1a47cc2e86
2 changed files with 5 additions and 5 deletions

View File

@@ -172,14 +172,15 @@ TEST_F(WireEncoderTextTest, MessageSubscribe) {
ASSERT_TRUE(net::WireEncodeText(os, msg));
ASSERT_EQ(os.str(),
"{\"method\":\"subscribe\",\"params\":{"
"\"options\":{},\"topics\":[\"a\",\"b\"],\"subuid\":5}}");
"\"options\":{},\"topics\":[\"a\",\"b\"],\"subuid\":402653189}}");
}
TEST_F(WireEncoderTextTest, MessageUnsubscribe) {
net::ClientMessage msg{
net::UnsubscribeMsg{Handle{0, 5, Handle::kSubscriber}}};
ASSERT_TRUE(net::WireEncodeText(os, msg));
ASSERT_EQ(os.str(), "{\"method\":\"unsubscribe\",\"params\":{\"subuid\":5}}");
ASSERT_EQ(os.str(),
"{\"method\":\"unsubscribe\",\"params\":{\"subuid\":402653189}}");
}
TEST_F(WireEncoderTextTest, MessageAnnounce) {