[Bf-blender-cvs] [07ef428c6c4] master: Cycles: Add regression test for util_md5_string

Sergey Sharybin noreply at git.blender.org
Wed Nov 2 16:30:32 CET 2022


Commit: 07ef428c6c41d74d267e2dbd505386e93f26de38
Author: Sergey Sharybin
Date:   Wed Nov 2 16:30:13 2022 +0100
Branches: master
https://developer.blender.org/rB07ef428c6c41d74d267e2dbd505386e93f26de38

Cycles: Add regression test for util_md5_string

===================================================================

M	intern/cycles/test/CMakeLists.txt
A	intern/cycles/test/util_md5_test.cpp

===================================================================

diff --git a/intern/cycles/test/CMakeLists.txt b/intern/cycles/test/CMakeLists.txt
index b126247de5f..c3ae81ed1db 100644
--- a/intern/cycles/test/CMakeLists.txt
+++ b/intern/cycles/test/CMakeLists.txt
@@ -34,6 +34,7 @@ set(SRC
   render_graph_finalize_test.cpp
   util_aligned_malloc_test.cpp
   util_math_test.cpp
+  util_md5_test.cpp
   util_path_test.cpp
   util_string_test.cpp
   util_task_test.cpp
diff --git a/intern/cycles/test/util_md5_test.cpp b/intern/cycles/test/util_md5_test.cpp
new file mode 100644
index 00000000000..abc147b70a1
--- /dev/null
+++ b/intern/cycles/test/util_md5_test.cpp
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright 2011-2022 Blender Foundation */
+
+#include "testing/testing.h"
+
+#include "util/md5.h"
+
+CCL_NAMESPACE_BEGIN
+
+TEST(util, util_md5_string)
+{
+  /* The hash is calculated using `echo -n "Hello, World\!" | md5 | tr '[:lower:]' '[:upper:]'`. */
+  EXPECT_EQ(util_md5_string("Hello, World!"), "65A8E27D8879283831B664BD8B7F0AD4");
+}
+
+CCL_NAMESPACE_END



More information about the Bf-blender-cvs mailing list