From 6af02192731b80c558a89a25f3cbf6916c2cbb72 Mon Sep 17 00:00:00 2001
From: Adam Moss <moss@lindenlab.com>
Date: Thu, 8 Oct 2009 16:44:44 +0000
Subject: [PATCH] DEV-41080 fix and upgrade v4color_test.cpp to a real unit
 test.

---
 indra/llmath/CMakeLists.txt         | 2 +-
 indra/llmath/tests/v4color_test.cpp | 2 +-
 indra/llmath/v3color.cpp            | 4 +---
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt
index dd13d8acd3d..e8b84eeabdc 100644
--- a/indra/llmath/CMakeLists.txt
+++ b/indra/llmath/CMakeLists.txt
@@ -90,6 +90,7 @@ SET(llmath_TEST_SOURCE_FILES
   llrect.cpp
   v2math.cpp
   v3color.cpp
+  v4color.cpp
   v4coloru.cpp
   )
 LL_ADD_PROJECT_UNIT_TESTS(llmath "${llmath_TEST_SOURCE_FILES}")
@@ -102,6 +103,5 @@ LL_ADD_INTEGRATION_TEST(mathmisc "" "${test_libs}")
 LL_ADD_INTEGRATION_TEST(llquaternion llquaternion.cpp "${test_libs}")
 LL_ADD_INTEGRATION_TEST(v3dmath v3dmath.cpp "${test_libs}")
 LL_ADD_INTEGRATION_TEST(v3math v3math.cpp "${test_libs}")
-LL_ADD_INTEGRATION_TEST(v4color v4color.cpp "${test_libs}")
 LL_ADD_INTEGRATION_TEST(v4math v4math.cpp "${test_libs}")
 LL_ADD_INTEGRATION_TEST(xform xform.cpp "${test_libs}")
diff --git a/indra/llmath/tests/v4color_test.cpp b/indra/llmath/tests/v4color_test.cpp
index 166c9b9ff2f..cebb026ce61 100644
--- a/indra/llmath/tests/v4color_test.cpp
+++ b/indra/llmath/tests/v4color_test.cpp
@@ -217,7 +217,7 @@ namespace tut
 		llcolor4a = llcolor3;
 		ensure("Operator=:Fail to initialize ", ((llcolor3.mV[0] == llcolor4a.mV[VX]) && (llcolor3.mV[1] == llcolor4a.mV[VY]) && (llcolor3.mV[2] == llcolor4a.mV[VZ])));
 		LLSD sd = llcolor4a.getValue();
-		llcolor4b = sd;
+		llcolor4b = LLColor4(sd);
 		ensure_equals("Operator= LLSD:Fail ", llcolor4a, llcolor4b);
 	}
 
diff --git a/indra/llmath/v3color.cpp b/indra/llmath/v3color.cpp
index e76607a91f2..b4cd410076a 100644
--- a/indra/llmath/v3color.cpp
+++ b/indra/llmath/v3color.cpp
@@ -56,9 +56,7 @@ LLColor3::LLColor3(const LLVector4 &a)
 
 LLColor3::LLColor3(const LLSD &sd)
 {
-	mV[0] = (F32) sd[0].asReal();
-	mV[1] = (F32) sd[1].asReal();
-	mV[2] = (F32) sd[2].asReal();
+	setValue(sd);
 }
 
 const LLColor3& LLColor3::operator=(const LLColor4 &a) 
-- 
GitLab