Browse Source

Added openBounded and closeBounded

Christophe Riccio 8 years ago
parent
commit
083782185e
2 changed files with 25 additions and 1 deletions
  1. 24 0
      test/ext/ext_vector_relational.cpp
  2. 1 1
      test/gtc/gtc_integer.cpp

+ 24 - 0
test/ext/ext_vector_relational.cpp

@@ -31,12 +31,36 @@ int test_notEqual()
 	return Error;
 	return Error;
 }
 }
 
 
+int test_openBounded()
+{
+	int Error = 0;
+
+	Error += glm::all(glm::openBounded(glm::ivec2(2), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1;
+	Error += !glm::all(glm::openBounded(glm::ivec2(1), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1;
+	Error += !glm::all(glm::openBounded(glm::ivec2(3), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1;
+
+	return Error;
+}
+
+int test_closeBounded()
+{
+	int Error = 0;
+
+	Error += glm::all(glm::closeBounded(glm::ivec2(2), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1;
+	Error += glm::all(glm::closeBounded(glm::ivec2(1), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1;
+	Error += glm::all(glm::closeBounded(glm::ivec2(3), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1;
+
+	return Error;
+}
+
 int main()
 int main()
 {
 {
 	int Error = 0;
 	int Error = 0;
 
 
 	Error += test_equal();
 	Error += test_equal();
 	Error += test_notEqual();
 	Error += test_notEqual();
+	Error += test_openBounded();
+	Error += test_closeBounded();
 
 
 	return Error;
 	return Error;
 }
 }

+ 1 - 1
test/gtc/gtc_integer.cpp

@@ -26,7 +26,7 @@ namespace log2_
 		glm::ivec3 D0(glm::log2(glm::vec3(16.f)));
 		glm::ivec3 D0(glm::log2(glm::vec3(16.f)));
 		glm::ivec4 E0(glm::log2(glm::vec4(16.f)));
 		glm::ivec4 E0(glm::log2(glm::vec4(16.f)));
 
 
-		int A1 = glm::log2(int(1024));
+		int A1 = glm::log2(int(16));
 		glm::ivec1 B1 = glm::log2(glm::ivec1(16));
 		glm::ivec1 B1 = glm::log2(glm::ivec1(16));
 		glm::ivec2 C1 = glm::log2(glm::ivec2(16));
 		glm::ivec2 C1 = glm::log2(glm::ivec2(16));
 		glm::ivec3 D1 = glm::log2(glm::ivec3(16));
 		glm::ivec3 D1 = glm::log2(glm::ivec3(16));