traeak commented on code in PR #12593:
URL: https://github.com/apache/trafficserver/pull/12593#discussion_r4484334258


##########
src/api/InkAPITest.cc:
##########
@@ -3193,23 +3193,21 @@ checkHttpTxnClientProtocolStackContains(SocketTest 
*test, void *data)
   return TS_EVENT_CONTINUE;
 }
 
-// This func is called by us from mytest_handler to check for 
TSHttpTxnNextStrategyGet
+// This func is called by us from mytest_handler to check 
TSHttpTxnNextHopStrategySet/Get.
+// No strategies are loaded here, so only rejection of an invalid handle is 
exercised.
 static int
-checkHttpTxnNextHopStrategyGet(SocketTest *test, void *data)
+checkHttpTxnNextHopStrategySetGet(SocketTest *test, void *data)
 {
   TSHttpTxn txnp = static_cast<TSHttpTxn>(data);
 
-  // this is an invalid pointer but the contents don't matter for this test.
-  void const *const exp = reinterpret_cast<void *>(0x01);
+  test->test_next_hop_strategy_get = true;
 
-  void const *const strategy = TSHttpTxnNextHopStrategyGet(txnp);
-  if (strategy == exp) {
-    test->test_next_hop_strategy_get = true;
-    SDK_RPRINT(test->regtest, "TSHttpTxnNextHopStrategyGet", "TestCase1", 
TC_PASS, "ok");
+  TSHttpTxnNextHopStrategySet(txnp, reinterpret_cast<TSStrategy>(0x01));
+  if (TSStrategy const strategy = TSHttpTxnNextHopStrategyGet(txnp); strategy 
== nullptr) {
+    SDK_RPRINT(test->regtest, "TSHttpTxnNextHopStrategySet", "TestCase1", 
TC_PASS, "ok");
   } else {
     test->test_next_hop_strategy_get = false;
-    SDK_RPRINT(test->regtest, "TSHttpTxnNextHopStrategyGet", "TestCase1", 
TC_FAIL, "Value's Mismatch [expected '%jx', got '%jx'",
-               exp, strategy);
+    SDK_RPRINT(test->regtest, "TSHttpTxnNextHopStrategySet", "TestCase1", 
TC_FAIL, "Invalid handle accepted [got '%p']", strategy);

Review Comment:
   taken



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to