aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2024-01-03 00:27:59 +0000
committerEric Kunze <eric.kunze@arm.com>2024-01-03 19:03:17 +0000
commitcc426df2a6762cb09c6a25c911039ae34660570c (patch)
tree5e341fa0ca388b7cd1bc944ff5124a30cb64fea5 /test
parent92358fc122cba98e373ca2ff42b1cfe7618161e8 (diff)
downloadserialization_lib-cc426df2a6762cb09c6a25c911039ae34660570c.tar.gz
Fix compiler warnings
No functional changes Change-Id: I938fecc941b14c065639e27a110ab1feb7c85ba9 Signed-off-by: Eric Kunze <eric.kunze@arm.com>
Diffstat (limited to 'test')
-rw-r--r--test/src/serialization_npy_test.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/test/src/serialization_npy_test.cpp b/test/src/serialization_npy_test.cpp
index 64536fb..24e3aff 100644
--- a/test/src/serialization_npy_test.cpp
+++ b/test/src/serialization_npy_test.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2021, ARM Limited.
+// Copyright (c) 2021,2024, ARM Limited.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@ int test_int_type(std::vector<int32_t> shape, std::default_random_engine& gen, s
}
auto buffer = std::make_unique<T[]>(total_size);
- for (int i = 0; i < total_size; i++)
+ for (size_t i = 0; i < total_size; i++)
{
buffer[i] = gen_data(gen);
}
@@ -76,7 +76,7 @@ int test_float_type(std::vector<int32_t> shape, std::default_random_engine& gen,
}
auto buffer = std::make_unique<T[]>(total_size);
- for (int i = 0; i < total_size; i++)
+ for (size_t i = 0; i < total_size; i++)
{
buffer[i] = gen_data(gen);
}
@@ -115,7 +115,7 @@ int test_double_type(std::vector<int32_t> shape, std::default_random_engine& gen
}
auto buffer = std::make_unique<T[]>(total_size);
- for (int i = 0; i < total_size; i++)
+ for (size_t i = 0; i < total_size; i++)
{
buffer[i] = gen_data(gen);
}
@@ -153,7 +153,7 @@ int test_bool_type(std::vector<int32_t> shape, std::default_random_engine& gen,
}
auto buffer = std::make_unique<bool[]>(total_size);
- for (int i = 0; i < total_size; i++)
+ for (size_t i = 0; i < total_size; i++)
{
buffer[i] = (gen_data(gen)) ? true : false;
}
@@ -183,15 +183,13 @@ int test_bool_type(std::vector<int32_t> shape, std::default_random_engine& gen,
int main(int argc, char** argv)
{
- size_t total_size = 1;
- int32_t seed = 1;
+ int32_t seed = 1;
std::string str_type;
std::string str_shape;
std::string filename = "npytest.npy";
std::vector<int32_t> shape;
- bool verbose = false;
int opt;
- while ((opt = getopt(argc, argv, "d:f:s:t:v")) != -1)
+ while ((opt = getopt(argc, argv, "d:f:s:t:")) != -1)
{
switch (opt)
{
@@ -207,9 +205,6 @@ int main(int argc, char** argv)
case 't':
str_shape = optarg;
break;
- case 'v':
- verbose = true;
- break;
default:
std::cerr << "Invalid argument" << std::endl;
break;
@@ -232,7 +227,6 @@ int main(int argc, char** argv)
break;
int val = stoi(substr, &pos, 0);
assert(val);
- total_size *= val;
shape.push_back(val);
}