This is an automated email from the ASF dual-hosted git repository.

cmcfarlen pushed a commit to branch NewAPIMetricsPOC
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/NewAPIMetricsPOC by this push:
     new 3a85a200b3 test operator[]
3a85a200b3 is described below

commit 3a85a200b330e5d71b9bc3517924ae31816c0d7e
Author: Chris McFarlen <[email protected]>
AuthorDate: Fri Jul 7 12:56:04 2023 -0500

    test operator[]
---
 src/api/test_Metrics.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/api/test_Metrics.cc b/src/api/test_Metrics.cc
index 099a34f943..d3713da0b3 100644
--- a/src/api/test_Metrics.cc
+++ b/src/api/test_Metrics.cc
@@ -56,6 +56,13 @@ TEST_CASE("Metrics", "[libtsapi][Metrics]")
     REQUIRE(m.get(fooid) == 1);
   }
 
+  SECTION("operator[]")
+  {
+    m[0].store(42);
+
+    REQUIRE(m.get(0) == 42);
+  }
+
   SECTION("dump")
   {
     m.recordsDump([](RecT, void *, int, const char *name, int value, RecData 
*) { printf("Fooo: %s: %d\n", name, value); },

Reply via email to