vppinfra: fix test_bihash 47/40147/2
authorDmitry Valter <d-valter@yandex-team.com>
Fri, 5 Jan 2024 14:30:15 +0000 (14:30 +0000)
committerDamjan Marion <dmarion@0xa5.net>
Fri, 19 Jan 2024 12:51:52 +0000 (12:51 +0000)
Correctly wrap data indices in test_bihash.

Type: fix
Signed-off-by: Dmitry Valter <d-valter@yandex-team.com>
Change-Id: I740fa1cf9f8c382c12f01f607095c5995be6845f

src/vppinfra/test_bihash_template.c

index af3ebb2..17cc056 100644 (file)
@@ -391,7 +391,7 @@ test_bihash (test_main_t * tm)
          for (i = 0; i < tm->nitems; i++)
            {
              /* Prefetch buckets 8 iterations ahead */
-             if (1 && (i < (tm->nitems - 8)))
+             if (1 && (i < ((i64) tm->nitems - 8)))
                {
                  BVT (clib_bihash_kv) pref_kv;
                  u64 pref_hash;
@@ -475,7 +475,7 @@ test_bihash (test_main_t * tm)
              for (j = 0; j < tm->nitems; j++)
                {
                  /* Prefetch buckets 8 iterations ahead */
-                 if (1 && (j < (tm->nitems - 8)))
+                 if (1 && (j < ((i64) tm->nitems - 8)))
                    {
                      BVT (clib_bihash_kv) pref_kv;
                      u64 pref_hash;