diff --git a/intern/cycles/test/CMakeLists.txt b/intern/cycles/test/CMakeLists.txt index 184e4b6af55..620729c36aa 100644 --- a/intern/cycles/test/CMakeLists.txt +++ b/intern/cycles/test/CMakeLists.txt @@ -32,6 +32,7 @@ set(SRC integrator_tile_test.cpp render_graph_finalize_test.cpp util_aligned_malloc_test.cpp + util_ies_test.cpp util_math_test.cpp util_md5_test.cpp util_path_test.cpp diff --git a/intern/cycles/test/util_ies_test.cpp b/intern/cycles/test/util_ies_test.cpp new file mode 100644 index 00000000000..e13ee11fabb --- /dev/null +++ b/intern/cycles/test/util_ies_test.cpp @@ -0,0 +1,18 @@ +/* SPDX-FileCopyrightText: 2011-2024 Blender Foundation + * + * SPDX-License-Identifier: Apache-2.0 */ + +#include "testing/testing.h" + +#include "util/ies.h" + +CCL_NAMESPACE_BEGIN + +TEST(util_ies, invalid) +{ + IESFile ies_file; + + EXPECT_FALSE(ies_file.load("Hello, World!")); +} + +CCL_NAMESPACE_END diff --git a/intern/cycles/util/ies.cpp b/intern/cycles/util/ies.cpp index 94983663dad..5bb593ddac1 100644 --- a/intern/cycles/util/ies.cpp +++ b/intern/cycles/util/ies.cpp @@ -63,11 +63,11 @@ void IESFile::pack(float *data) class IESTextParser { public: - vector text; + string text; char *data; bool error; - IESTextParser(const string &str) : text(str.begin(), str.end()), error(false) + IESTextParser(const string &str) : text(str), error(false) { std::replace(text.begin(), text.end(), ',', ' '); data = strstr(&text[0], "\nTILT=");