]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Remove more unused structures from unit tests
authorJustin Viiret <justin.viiret@intel.com>
Fri, 12 Feb 2016 02:52:39 +0000 (13:52 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 1 Mar 2016 00:34:38 +0000 (11:34 +1100)
The NFA, LBR no longer need scratch or the NFAContext structure stored
outside the NFA stack.

unit/internal/lbr.cpp
unit/internal/limex_nfa.cpp

index be53d9f399be2ef0159ca22dd190b4f73209ffe3..bb180e5fe35b6d186d4cd2b0794d7e1aa6aadc5f 100644 (file)
@@ -36,7 +36,6 @@
 #include "nfa/nfa_internal.h"
 #include "nfa/nfa_api_util.h"
 #include "nfagraph/ng_lbr.h"
-#include "scratch.h"
 #include "util/alloc.h"
 #include "util/compile_context.h"
 #include "grey.h"
@@ -155,9 +154,6 @@ protected:
     // Space for stream state.
     aligned_unique_ptr<char> stream_state;
 
-    // Space for NFAContext structure.
-    aligned_unique_ptr<void> nfa_context;
-
     // Queue structure.
     struct mq q;
 };
index 7c0b66e4bfd5df9ab3a652b3d886f175e06b3f30..6d77fffe5eb22d0c1d58db5ce08e04215cee73da 100644 (file)
@@ -39,7 +39,6 @@
 #include "nfa/nfa_api.h"
 #include "nfa/nfa_api_util.h"
 #include "nfa/nfa_internal.h"
-#include "scratch.h"
 #include "util/alloc.h"
 #include "util/target_info.h"
 
@@ -86,11 +85,6 @@ protected:
 
         full_state = aligned_zmalloc_unique<char>(nfa->scratchStateSize);
         stream_state = aligned_zmalloc_unique<char>(nfa->streamStateSize);
-        nfa_context = aligned_zmalloc_unique<void>(sizeof(NFAContext512));
-
-        // Mock up a scratch structure that contains the pieces that we need
-        // for NFA execution.
-        scratch = aligned_zmalloc_unique<hs_scratch>(sizeof(struct hs_scratch));
     }
 
     virtual void initQueue() {
@@ -125,12 +119,6 @@ protected:
     // Space for stream state.
     aligned_unique_ptr<char> stream_state;
 
-    // Space for NFAContext structure.
-    aligned_unique_ptr<void> nfa_context;
-
-    // Mock scratch.
-    aligned_unique_ptr<hs_scratch> scratch;
-
     // Queue structure.
     struct mq q;
 };
@@ -331,12 +319,6 @@ protected:
 
         nfa = constructReversedNFA(g_rev, type, cc);
         ASSERT_TRUE(nfa != nullptr);
-
-        nfa_context = aligned_zmalloc_unique<void>(sizeof(NFAContext512));
-
-        // Mock up a scratch structure that contains the pieces that we need
-        // for reverse NFA execution.
-        scratch = aligned_zmalloc_unique<hs_scratch>(sizeof(struct hs_scratch));
     }
 
     // NFA type (enum NFAEngineType)
@@ -347,12 +329,6 @@ protected:
 
     // Compiled NFA structure.
     aligned_unique_ptr<NFA> nfa;
-
-    // Space for NFAContext structure.
-    aligned_unique_ptr<void> nfa_context;
-
-    // Mock scratch.
-    aligned_unique_ptr<hs_scratch> scratch;
 };
 
 INSTANTIATE_TEST_CASE_P(LimExReverse, LimExReverseTest,
@@ -401,11 +377,6 @@ protected:
 
         full_state = aligned_zmalloc_unique<char>(nfa->scratchStateSize);
         stream_state = aligned_zmalloc_unique<char>(nfa->streamStateSize);
-        nfa_context = aligned_zmalloc_unique<void>(sizeof(NFAContext512));
-
-        // Mock up a scratch structure that contains the pieces that we need
-        // for NFA execution.
-        scratch = aligned_zmalloc_unique<hs_scratch>(sizeof(struct hs_scratch));
     }
 
     virtual void initQueue() {
@@ -440,12 +411,6 @@ protected:
     // Space for stream state.
     aligned_unique_ptr<char> stream_state;
 
-    // Space for NFAContext structure.
-    aligned_unique_ptr<void> nfa_context;
-
-    // Mock scratch.
-    aligned_unique_ptr<hs_scratch> scratch;
-
     // Queue structure.
     struct mq q;
 };