]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Enable unittests for flow q handler
authorAnoop Saldanha <poonaatsoc@gmail.com>
Thu, 12 Jan 2012 11:01:08 +0000 (16:31 +0530)
committerVictor Julien <victor@inliniac.net>
Mon, 19 Mar 2012 11:55:41 +0000 (12:55 +0100)
src/tmqh-flow.c

index 92cb70c5281aa4dd39269b5a168513c8db63329b..f17237c0c5e9e664dd5738e7b9a3f10272dae1ac 100644 (file)
@@ -331,7 +331,6 @@ void TmqhFlowPrintStatistics(void)
 
 #ifdef UNITTESTS
 
-#if 0
 static int TmqhOutputFlowSetupCtxTest01(void) {
     int retval = 0;
     Tmq *tmq = NULL;
@@ -365,13 +364,13 @@ static int TmqhOutputFlowSetupCtxTest01(void) {
     if (fctx->queues == NULL)
         goto end;
 
-    if (fctx->queues[0] != 0)
+    if (fctx->queues[0].q != &trans_q[0])
         goto end;
-    if (fctx->queues[1] != 1)
+    if (fctx->queues[1].q != &trans_q[1])
         goto end;
-    if (fctx->queues[2] != 2)
+    if (fctx->queues[2].q != &trans_q[2])
         goto end;
-    if (fctx->queues[3] != 3)
+    if (fctx->queues[3].q != &trans_q[3])
         goto end;
 
     retval = 1;
@@ -413,7 +412,7 @@ static int TmqhOutputFlowSetupCtxTest02(void) {
     if (fctx->queues == NULL)
         goto end;
 
-    if (fctx->queues[0] != 0)
+    if (fctx->queues[0].q != &trans_q[0])
         goto end;
 
     retval = 1;
@@ -441,13 +440,13 @@ static int TmqhOutputFlowSetupCtxTest03(void) {
     if (fctx->queues == NULL)
         goto end;
 
-    if (fctx->queues[0] != 0)
+    if (fctx->queues[0].q != &trans_q[0])
         goto end;
-    if (fctx->queues[1] != 1)
+    if (fctx->queues[1].q != &trans_q[1])
         goto end;
-    if (fctx->queues[2] != 2)
+    if (fctx->queues[2].q != &trans_q[2])
         goto end;
-    if (fctx->queues[3] != 3)
+    if (fctx->queues[3].q != &trans_q[3])
         goto end;
 
     retval = 1;
@@ -455,17 +454,14 @@ end:
     TmqResetQueues();
     return retval;
 }
-#endif
 
 #endif /* UNITTESTS */
 
 void TmqhFlowRegisterTests(void) {
 #ifdef UNITTESTS
-#if 0
     UtRegisterTest("TmqhOutputFlowSetupCtxTest01", TmqhOutputFlowSetupCtxTest01, 1);
     UtRegisterTest("TmqhOutputFlowSetupCtxTest02", TmqhOutputFlowSetupCtxTest02, 1);
     UtRegisterTest("TmqhOutputFlowSetupCtxTest03", TmqhOutputFlowSetupCtxTest03, 1);
 #endif
-#endif
 }