From 1add4cc261f4dfa31b3c03a454a443a345358b7c Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 10 Aug 2025 10:45:13 -0700 Subject: fixes #2146 need statistics for PUB protocol --- src/sp/protocol/pubsub0/pub_test.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/sp/protocol/pubsub0/pub_test.c') diff --git a/src/sp/protocol/pubsub0/pub_test.c b/src/sp/protocol/pubsub0/pub_test.c index 2b571bef..3018ced9 100644 --- a/src/sp/protocol/pubsub0/pub_test.c +++ b/src/sp/protocol/pubsub0/pub_test.c @@ -96,6 +96,17 @@ test_pub_send_no_pipes(void) NUTS_PASS(nng_pub0_open(&pub)); NUTS_SEND(pub, "DROP1"); NUTS_SEND(pub, "DROP2"); + + nng_stat *stats; + const nng_stat *pubs; + NUTS_PASS(nng_stats_get(&stats)); + + NUTS_TRUE(stats != NULL); + NUTS_TRUE((pubs = nng_stat_find_socket(stats, pub)) != NULL); + + nng_stats_dump(pubs); + nng_stats_free(stats); + NUTS_CLOSE(pub); } @@ -127,6 +138,7 @@ test_pub_validate_peer(void) NUTS_CLOSE(s1); NUTS_CLOSE(s2); + nng_stats_dump(stats); nng_stats_free(stats); } @@ -157,6 +169,16 @@ test_pub_send_queued(void) NUTS_RECV(sub, "three musketeers"); NUTS_RECV(sub, "four"); + nng_stat *stats; + const nng_stat *pubs; + NUTS_PASS(nng_stats_get(&stats)); + + NUTS_TRUE(stats != NULL); + NUTS_TRUE((pubs = nng_stat_find_socket(stats, pub)) != NULL); + + nng_stats_dump(pubs); + nng_stats_free(stats); + NUTS_CLOSE(pub); NUTS_CLOSE(sub); } -- cgit v1.2.3-70-g09d2