From 650be8187e9c675177f54283fee793be4b99341e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com>
Date: Thu, 26 Aug 2021 14:40:09 +0200
Subject: [PATCH] MAINT: move increment to the end to prevent decrease below
 value bound

---
 test/test_transaction.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/test/test_transaction.cpp b/test/test_transaction.cpp
index da26362..844c829 100644
--- a/test/test_transaction.cpp
+++ b/test/test_transaction.cpp
@@ -691,9 +691,7 @@ auto test_numeric_values_impl(AtomicDataType a_type) -> void {
   auto values_orig = test_transaction::generateValues<T>();
   auto props_orig = std::vector<Entity>();
   size_t i = 0;
-  --i;
   for (auto value : values_orig) {
-    ++i;
     auto insert_transaction(connection->CreateTransaction());
     Entity prop;
     prop.SetRole(Role::PROPERTY);
@@ -711,13 +709,12 @@ auto test_numeric_values_impl(AtomicDataType a_type) -> void {
     auto t_stat = insert_transaction->WaitForIt();
     EXPECT_TRUE(t_stat.IsTerminated());
     EXPECT_FALSE(t_stat.IsError());
+    ++i;
   }
 
   // Retrieve and verify
   i = 0;
-  --i;
   for (const auto value : values_orig) {
-    ++i;
     auto retrieve_transaction(connection->CreateTransaction());
     const auto prop = props_orig[i];
     const auto name =
@@ -736,6 +733,7 @@ auto test_numeric_values_impl(AtomicDataType a_type) -> void {
         test_transaction::getValueAs<T>(result.GetValue());
     // std::cout << "retrieved_value: " << retrieved_value << std::endl;
     EXPECT_EQ(retrieved_value, value);
+    ++i;
   }
 }
 
-- 
GitLab