Browse Source

Remove two dead writes in tests, to silence scan-build warnings.

Arthur O'Dwyer 4 years ago
parent
commit
45af88cd1f
2 changed files with 3 additions and 8 deletions
  1. 2 5
      tests/test76.c
  2. 1 3
      tests/test77.c

+ 2 - 5
tests/test76.c

@@ -8,8 +8,8 @@ int main()
     char V_NeedleStr[] = "needle\0s";
     long *V_KMP_Table;
     long V_FindPos;
-    size_t V_StartPos;
-    size_t V_FindCnt;
+    size_t V_StartPos = 0;
+    size_t V_FindCnt = 0;
 
 
     utstring_new(s);
@@ -24,9 +24,6 @@ int main()
     if (V_KMP_Table != NULL) {
         _utstring_BuildTable(utstring_body(t), utstring_len(t), V_KMP_Table);
 
-        V_FindCnt = 0;
-        V_FindPos = 0;
-        V_StartPos = 0;
         do {
             V_FindPos = _utstring_find(utstring_body(s) + V_StartPos,
                                        utstring_len(s) - V_StartPos,

+ 1 - 3
tests/test77.c

@@ -9,7 +9,7 @@ int main()
     long *V_KMP_Table;
     long V_FindPos;
     size_t V_StartPos;
-    size_t V_FindCnt;
+    size_t V_FindCnt = 0;
 
 
     utstring_new(s);
@@ -24,8 +24,6 @@ int main()
     if (V_KMP_Table != NULL) {
         _utstring_BuildTableR(utstring_body(t), utstring_len(t), V_KMP_Table);
 
-        V_FindCnt = 0;
-        V_FindPos = 0;
         V_StartPos = utstring_len(s) - 1;
         do {
             V_FindPos = _utstring_findR(utstring_body(s),