@@ -38,7 +38,7 @@ namespace retrycache_test
3838 std::cout << " CstResolver [Selected]: resolves the constraint and notifies." << std::endl;
3939 auto it = consumer.m_toSync .begin ();
4040 consumer.m_toSync .erase (it);
41- Constraint cst = make_constraint (RETRY_CST_NHG , " 2" );
41+ Constraint cst = make_constraint (RETRY_CST_PIC , " 2" );
4242 notifyRetry (this , " Dependent" , cst);
4343 }
4444 else if (consumer.getName () == " Dependent" )
@@ -64,7 +64,7 @@ namespace retrycache_test
6464 TestOrch* testOrch;
6565 Consumer *oftenFail, *cstResolver;
6666 RetryCache* cache;
67- Constraint cst = make_constraint(RETRY_CST_NHG , " 2" );
67+ Constraint cst = make_constraint(RETRY_CST_PIC , " 2" );
6868
6969 void SetUp () override
7070 {
@@ -103,7 +103,7 @@ namespace retrycache_test
103103 ASSERT_TRUE (cache->getRetryMap ().empty ());
104104
105105 cache->insert ({" key" , " DEL" , {}}, cst);
106- Constraint _cst = make_constraint (RETRY_CST_NHG , " 3" );
106+ Constraint _cst = make_constraint (RETRY_CST_PIC , " 3" );
107107 cache->insert ({" key" , " SET" , {{" nexthop_index" , " 3" }}}, _cst);
108108 tasks = cache->resolve (cst);
109109 ASSERT_EQ (tasks->size (), 1 );
@@ -121,9 +121,9 @@ namespace retrycache_test
121121 std::cout << " Orchdaemon Event Loop 1: " << std::endl;
122122
123123 // Assume the Dependent Executor receives a task to process
124- Task task{" TEST_ROUTE" , " SET" , {{" NHG " , " 2" }}};
124+ Task task{" TEST_ROUTE" , " SET" , {{" PIC " , " 2" }}};
125125 oftenFail->addToSync (task);
126- // But it fails because of the constraint: nhg 2 doesn't exist
126+ // But it fails because of the constraint: PIC 2 doesn't exist
127127 // It moves the task from m_toSync to m_toRetry
128128 oftenFail->drain ();
129129
@@ -150,7 +150,7 @@ namespace retrycache_test
150150 std::cout << " Orchdaemon Event Loop 2: " << std::endl;
151151
152152 // Assume in the next event loop, the cstResolver a task to process, which resolves the constraint for oftenFail.
153- cstResolver->addToSync ({" TEST_NHG " , " SET" , {{" ID" , " 2" }}});
153+ cstResolver->addToSync ({" TEST_PIC " , " SET" , {{" ID" , " 2" }}});
154154 cstResolver->drain ();
155155
156156 // Post-resolution
@@ -221,7 +221,7 @@ namespace retrycache_test
221221
222222 // Assume there are a SET and a DEL task in the retry cache
223223 cache->insert (setTask, cst);
224- Constraint del_cst = make_constraint (RETRY_CST_NHG_REF , " " );
224+ Constraint del_cst = make_constraint (RETRY_CST_PIC_REF , " " );
225225 cache->insert (delTask, del_cst);
226226 ASSERT_EQ (cache->getRetryMap ().size (), 2 );
227227
@@ -239,24 +239,24 @@ namespace retrycache_test
239239 TEST_F (RetryCacheTest, NewSetTask)
240240 {
241241 // Assume there is an old SET task in the retry cache
242- Task setTask{" TEST_ROUTE" , " SET" , {{" NHG " , " 1" }}};
243- Constraint cst_nhg_1 = make_constraint (RETRY_CST_NHG , " 1" );
244- cache->insert (setTask, cst_nhg_1 );
242+ Task setTask{" TEST_ROUTE" , " SET" , {{" PIC " , " 1" }}};
243+ Constraint cst_pic_1 = make_constraint (RETRY_CST_PIC , " 1" );
244+ cache->insert (setTask, cst_pic_1 );
245245
246246 // Assume there is a new task with same field, received by the consumer
247- Task setTask2{" TEST_ROUTE" , " SET" , {{" NHG " , " 2" }}};
247+ Task setTask2{" TEST_ROUTE" , " SET" , {{" PIC " , " 2" }}};
248248 oftenFail->addToSync (setTask2);
249249 // Check if it clears the retrycache
250250 ASSERT_TRUE (cache->getRetryMap ().empty ());
251- ASSERT_EQ (cache->m_retryKeys .find (cst_nhg_1 ), cache->m_retryKeys .end ());
251+ ASSERT_EQ (cache->m_retryKeys .find (cst_pic_1 ), cache->m_retryKeys .end ());
252252 // Check if it adds the task 2 into the sync queue
253253 auto iter = oftenFail->m_toSync .find (" TEST_ROUTE" );
254254 ASSERT_EQ (iter->second , setTask2);
255255
256- // Assume NHG 2 also doesn't exist, the new task fails too
256+ // Assume PIC 2 also doesn't exist, the new task fails too
257257 oftenFail->m_toSync .erase (iter);
258- Constraint cst_nhg2 = make_constraint (RETRY_CST_NHG , " 2" );
259- cache->insert (setTask2, cst_nhg2 );
258+ Constraint cst_pic_2 = make_constraint (RETRY_CST_PIC , " 2" );
259+ cache->insert (setTask2, cst_pic_2 );
260260
261261 // Assume there is a new SET task with a new field, received by the consumer
262262 Task setTask3{" TEST_ROUTE" , " SET" , {{" VRF" , " 1" }}};
@@ -274,7 +274,7 @@ namespace retrycache_test
274274 {
275275 if (fvField (fv) == " VRF" )
276276 ASSERT_EQ (fvValue (fv), " 1" );
277- else if (fvField (fv) == " NHG " )
277+ else if (fvField (fv) == " PIC " )
278278 ASSERT_EQ (fvValue (fv), " 2" );
279279 else
280280 ASSERT_FALSE (true ); // unexpected field
@@ -287,8 +287,8 @@ namespace retrycache_test
287287 // simulate by firstly adding a DEL, then adding a SET into the retry cache
288288 Task delTask{" TEST_ROUTE" , " DEL" , {{" " , " " }}};
289289 cache->insert (delTask, DUMMY_CONSTRAINT);
290- Task setTask{" TEST_ROUTE" , " SET" , {{" NHG " , " 1" }}};
291- Constraint cst = make_constraint (RETRY_CST_NHG , " 1" );
290+ Task setTask{" TEST_ROUTE" , " SET" , {{" PIC " , " 1" }}};
291+ Constraint cst = make_constraint (RETRY_CST_PIC , " 1" );
292292 cache->insert (setTask, cst);
293293
294294 ASSERT_EQ (cache->getRetryMap ().size (), 2 );
@@ -308,7 +308,7 @@ namespace retrycache_test
308308 {
309309 if (fvField (fv) == " VRF" )
310310 ASSERT_EQ (fvValue (fv), " 1" );
311- else if (fvField (fv) == " NHG " )
311+ else if (fvField (fv) == " PIC " )
312312 ASSERT_EQ (fvValue (fv), " 1" );
313313 else
314314 ASSERT_FALSE (true ); // unexpected field
0 commit comments