Browse Source

Added bitfieldRotate tests #862

Christophe Riccio 6 years ago
parent
commit
daf14f0f74
1 changed files with 19 additions and 0 deletions
  1. 19 0
      test/gtc/gtc_bitfield.cpp

+ 19 - 0
test/gtc/gtc_bitfield.cpp

@@ -895,6 +895,22 @@ namespace bitfieldInterleave5
 
 }//namespace bitfieldInterleave5
 
+static int test_bitfieldRotateRight()
+{
+	glm::ivec4 const A = glm::bitfieldRotateRight(glm::ivec4(2), 1);
+	glm::ivec4 const B = glm::ivec4(2) >> 1;
+
+	return A == B;
+}
+
+static int test_bitfieldRotateLeft()
+{
+	glm::ivec4 const A = glm::bitfieldRotateLeft(glm::ivec4(2), 1);
+	glm::ivec4 const B = glm::ivec4(2) << 1;
+
+	return A == B;
+}
+
 int main()
 {
 	int Error = 0;
@@ -908,6 +924,9 @@ int main()
 	Error += ::bitfieldInterleave4::test();
 	Error += ::bitfieldInterleave::test();
 
+	Error += test_bitfieldRotateRight();
+	Error += test_bitfieldRotateLeft();
+
 #	ifdef NDEBUG
 		Error += ::mask::perf();
 		Error += ::bitfieldInterleave::perf();