Removed <iostream> in GLM tests, use <cstdio> instead

This commit is contained in:
Christophe Riccio 2014-11-15 00:49:12 +01:00
parent d606eaf2da
commit 141c1856a7
10 changed files with 62 additions and 70 deletions

View File

@ -72,6 +72,7 @@ Improvements:
- Reduced integer type redifinitions #233 - Reduced integer type redifinitions #233
- Rewrited of GTX_fast_trigonometry #264 #265 - Rewrited of GTX_fast_trigonometry #264 #265
- Made types trivially copyable #263 - Made types trivially copyable #263
- Removed <iostream> in GLM tests
Fixes: Fixes:
- Fixed std::nextafter not supported with C++11 on Android #217 - Fixed std::nextafter not supported with C++11 on Android #217

View File

@ -9,7 +9,7 @@
#define GLM_MESSAGES #define GLM_MESSAGES
#include <glm/vec3.hpp> #include <glm/vec3.hpp>
#include <iostream> #include <cstdio>
int test_compiler() int test_compiler()
{ {
@ -20,22 +20,22 @@ int test_compiler()
switch(GLM_COMPILER) switch(GLM_COMPILER)
{ {
case GLM_COMPILER_VC10: case GLM_COMPILER_VC10:
std::cout << "GLM_COMPILER_VC10" << std::endl; std::printf("GLM_COMPILER_VC10\n");
break; break;
case GLM_COMPILER_VC11: case GLM_COMPILER_VC11:
std::cout << "GLM_COMPILER_VC11" << std::endl; std::printf("GLM_COMPILER_VC11\n");
break; break;
case GLM_COMPILER_VC12: case GLM_COMPILER_VC12:
std::cout << "GLM_COMPILER_VC12" << std::endl; std::printf("GLM_COMPILER_VC12\n");
break; break;
case GLM_COMPILER_VC13: case GLM_COMPILER_VC13:
std::cout << "GLM_COMPILER_VC13" << std::endl; std::printf("GLM_COMPILER_VC13\n");
break; break;
case GLM_COMPILER_VC14: case GLM_COMPILER_VC14:
std::cout << "GLM_COMPILER_VC14" << std::endl; std::printf("GLM_COMPILER_VC14\n");
break; break;
default: default:
std::cout << "Visual C++ version not detected" << std::endl; std::printf("Visual C++ version not detected\n");
Error += 1; Error += 1;
break; break;
} }
@ -45,66 +45,66 @@ int test_compiler()
switch(GLM_COMPILER) switch(GLM_COMPILER)
{ {
case GLM_COMPILER_GCC42: case GLM_COMPILER_GCC42:
std::cout << "GLM_COMPILER_GCC42" << std::endl; std::printf("GLM_COMPILER_GCC42\n");
break; break;
case GLM_COMPILER_GCC43: case GLM_COMPILER_GCC43:
std::cout << "GLM_COMPILER_GCC43" << std::endl; std::printf("GLM_COMPILER_GCC43\n");
break; break;
case GLM_COMPILER_GCC44: case GLM_COMPILER_GCC44:
std::cout << "GLM_COMPILER_GCC44" << std::endl; std::printf("GLM_COMPILER_GCC44\n");
break; break;
case GLM_COMPILER_GCC45: case GLM_COMPILER_GCC45:
std::cout << "GLM_COMPILER_GCC45" << std::endl; std::printf("GLM_COMPILER_GCC45\n");
break; break;
case GLM_COMPILER_GCC46: case GLM_COMPILER_GCC46:
std::cout << "GLM_COMPILER_GCC46" << std::endl; std::printf("GLM_COMPILER_GCC46\n");
break; break;
case GLM_COMPILER_GCC47: case GLM_COMPILER_GCC47:
std::cout << "GLM_COMPILER_GCC47" << std::endl; std::printf("GLM_COMPILER_GCC47\n");
break; break;
case GLM_COMPILER_GCC48: case GLM_COMPILER_GCC48:
std::cout << "GLM_COMPILER_GCC48" << std::endl; std::printf("GLM_COMPILER_GCC48\n");
break; break;
case GLM_COMPILER_GCC49: case GLM_COMPILER_GCC49:
std::cout << "GLM_COMPILER_GCC49" << std::endl; std::printf("GLM_COMPILER_GCC49\n");
break; break;
case GLM_COMPILER_GCC50: case GLM_COMPILER_GCC50:
std::cout << "GLM_COMPILER_GCC50" << std::endl; std::printf("GLM_COMPILER_GCC50\n");
break; break;
default: default:
std::cout << "GCC version not detected" << std::endl; std::printf("GCC version not detected\n");
Error += 1; Error += 1;
break; break;
} }
} }
else if(GLM_COMPILER & GLM_COMPILER_CUDA) else if(GLM_COMPILER & GLM_COMPILER_CUDA)
{ {
std::cout << "GLM_COMPILER_CUDA" << std::endl; std::printf("GLM_COMPILER_CUDA\n");
} }
else if(GLM_COMPILER & GLM_COMPILER_APPLE_CLANG) else if(GLM_COMPILER & GLM_COMPILER_APPLE_CLANG)
{ {
switch(GLM_COMPILER) switch(GLM_COMPILER)
{ {
case GLM_COMPILER_APPLE_CLANG40: case GLM_COMPILER_APPLE_CLANG40:
std::cout << "GLM_COMPILER_APPLE_CLANG40" << std::endl; std::printf("GLM_COMPILER_APPLE_CLANG40\n");
break; break;
case GLM_COMPILER_APPLE_CLANG41: case GLM_COMPILER_APPLE_CLANG41:
std::cout << "GLM_COMPILER_APPLE_CLANG41" << std::endl; std::printf("GLM_COMPILER_APPLE_CLANG41\n");
break; break;
case GLM_COMPILER_APPLE_CLANG42: case GLM_COMPILER_APPLE_CLANG42:
std::cout << "GLM_COMPILER_APPLE_CLANG42" << std::endl; std::printf("GLM_COMPILER_APPLE_CLANG42\n");
break; break;
case GLM_COMPILER_APPLE_CLANG50: case GLM_COMPILER_APPLE_CLANG50:
std::cout << "GLM_COMPILER_APPLE_CLANG50" << std::endl; std::printf("GLM_COMPILER_APPLE_CLANG50\n");
break; break;
case GLM_COMPILER_APPLE_CLANG51: case GLM_COMPILER_APPLE_CLANG51:
std::cout << "GLM_COMPILER_APPLE_CLANG51" << std::endl; std::printf("GLM_COMPILER_APPLE_CLANG51\n");
break; break;
case GLM_COMPILER_APPLE_CLANG60: case GLM_COMPILER_APPLE_CLANG60:
std::cout << "GLM_COMPILER_APPLE_CLANG60" << std::endl; std::printf("GLM_COMPILER_APPLE_CLANG60\n");
break; break;
default: default:
std::cout << "Apple Clang version not detected" << std::endl; std::printf("Apple Clang version not detected\n");
break; break;
} }
} }
@ -113,25 +113,25 @@ int test_compiler()
switch(GLM_COMPILER) switch(GLM_COMPILER)
{ {
case GLM_COMPILER_LLVM30: case GLM_COMPILER_LLVM30:
std::cout << "GLM_COMPILER_LLVM30" << std::endl; std::printf("GLM_COMPILER_LLVM30\n");
break; break;
case GLM_COMPILER_LLVM31: case GLM_COMPILER_LLVM31:
std::cout << "GLM_COMPILER_LLVM31" << std::endl; std::printf("GLM_COMPILER_LLVM31\n");
break; break;
case GLM_COMPILER_LLVM32: case GLM_COMPILER_LLVM32:
std::cout << "GLM_COMPILER_LLVM32" << std::endl; std::printf("GLM_COMPILER_LLVM32\n");
break; break;
case GLM_COMPILER_LLVM33: case GLM_COMPILER_LLVM33:
std::cout << "GLM_COMPILER_LLVM33" << std::endl; std::printf("GLM_COMPILER_LLVM33\n");
break; break;
case GLM_COMPILER_LLVM34: case GLM_COMPILER_LLVM34:
std::cout << "GLM_COMPILER_LLVM34" << std::endl; std::printf("GLM_COMPILER_LLVM34\n");
break; break;
case GLM_COMPILER_LLVM35: case GLM_COMPILER_LLVM35:
std::cout << "GLM_COMPILER_LLVM35" << std::endl; std::printf("GLM_COMPILER_LLVM35\n");
break; break;
default: default:
std::cout << "LLVM version not detected" << std::endl; std::printf("LLVM version not detected\n");
break; break;
} }
} }
@ -140,29 +140,29 @@ int test_compiler()
switch(GLM_COMPILER) switch(GLM_COMPILER)
{ {
case GLM_COMPILER_INTEL12: case GLM_COMPILER_INTEL12:
std::cout << "GLM_COMPILER_INTEL12" << std::endl; std::printf("GLM_COMPILER_INTEL12\n");
break; break;
case GLM_COMPILER_INTEL12_1: case GLM_COMPILER_INTEL12_1:
std::cout << "GLM_COMPILER_INTEL12_1" << std::endl; std::printf("GLM_COMPILER_INTEL12_1\n");
break; break;
case GLM_COMPILER_INTEL13: case GLM_COMPILER_INTEL13:
std::cout << "GLM_COMPILER_INTEL13" << std::endl; std::printf("GLM_COMPILER_INTEL13\n");
break; break;
case GLM_COMPILER_INTEL14: case GLM_COMPILER_INTEL14:
std::cout << "GLM_COMPILER_INTEL14" << std::endl; std::printf("GLM_COMPILER_INTEL14\n");
break; break;
case GLM_COMPILER_INTEL15: case GLM_COMPILER_INTEL15:
std::cout << "GLM_COMPILER_INTEL15" << std::endl; std::printf("GLM_COMPILER_INTEL15\n");
break; break;
default: default:
std::cout << "Intel compiler version not detected" << std::endl; std::printf("Intel compiler version not detected\n");
Error += 1; Error += 1;
break; break;
} }
} }
else else
{ {
std::cout << "Undetected compiler" << std::endl; std::printf("Undetected compiler\n");
Error += 1; Error += 1;
} }
@ -176,9 +176,9 @@ int test_model()
Error += ((sizeof(void*) == 4) && (GLM_MODEL == GLM_MODEL_32)) || ((sizeof(void*) == 8) && (GLM_MODEL == GLM_MODEL_64)) ? 0 : 1; Error += ((sizeof(void*) == 4) && (GLM_MODEL == GLM_MODEL_32)) || ((sizeof(void*) == 8) && (GLM_MODEL == GLM_MODEL_64)) ? 0 : 1;
if(GLM_MODEL == GLM_MODEL_32) if(GLM_MODEL == GLM_MODEL_32)
std::cout << "GLM_MODEL_32" << std::endl; std::printf("GLM_MODEL_32\n");
else if(GLM_MODEL == GLM_MODEL_64) else if(GLM_MODEL == GLM_MODEL_64)
std::cout << "GLM_MODEL_64" << std::endl; std::printf("GLM_MODEL_64\n");
return Error; return Error;
} }
@ -187,29 +187,29 @@ int test_instruction_set()
{ {
int Error = 0; int Error = 0;
std::cout << "GLM_ARCH: "; std::printf("GLM_ARCH: ");
if(GLM_ARCH == GLM_ARCH_PURE) if(GLM_ARCH == GLM_ARCH_PURE)
std::cout << "GLM_ARCH_PURE "; std::printf("GLM_ARCH_PURE ");
if(GLM_ARCH & GLM_ARCH_AVX2) if(GLM_ARCH & GLM_ARCH_AVX2)
std::cout << "GLM_ARCH_AVX2 "; std::printf("GLM_ARCH_AVX2 ");
if(GLM_ARCH & GLM_ARCH_AVX) if(GLM_ARCH & GLM_ARCH_AVX)
std::cout << "GLM_ARCH_AVX "; std::printf("GLM_ARCH_AVX ");
if(GLM_ARCH & GLM_ARCH_AVX) if(GLM_ARCH & GLM_ARCH_AVX)
std::cout << "GLM_ARCH_SSE4 "; std::printf("GLM_ARCH_SSE4 ");
if(GLM_ARCH & GLM_ARCH_SSE3) if(GLM_ARCH & GLM_ARCH_SSE3)
std::cout << "GLM_ARCH_SSE3 "; std::printf("GLM_ARCH_SSE3 ");
if(GLM_ARCH & GLM_ARCH_SSE2) if(GLM_ARCH & GLM_ARCH_SSE2)
std::cout << "GLM_ARCH_SSE2 "; std::printf("GLM_ARCH_SSE2 ");
std::cout << std::endl; std::printf("\n");
return Error; return Error;
} }
int test_cpp_version() int test_cpp_version()
{ {
std::cout << "__cplusplus: " << __cplusplus << std::endl; std::printf("__cplusplus: %d\n", __cplusplus);
return 0; return 0;
} }

View File

@ -10,7 +10,6 @@
#include <glm/gtc/noise.hpp> #include <glm/gtc/noise.hpp>
#include <gli/gli.hpp> #include <gli/gli.hpp>
#include <gli/gtx/loader.hpp> #include <gli/gtx/loader.hpp>
#include <iostream>
int test_simplex() int test_simplex()
{ {

View File

@ -9,7 +9,6 @@
#include <glm/gtc/random.hpp> #include <glm/gtc/random.hpp>
#include <glm/gtc/epsilon.hpp> #include <glm/gtc/epsilon.hpp>
#include <iostream>
#if(GLM_LANG & GLM_LANG_CXX0X_FLAG) #if(GLM_LANG & GLM_LANG_CXX0X_FLAG)
# include <array> # include <array>
#endif #endif

View File

@ -8,7 +8,6 @@
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/gtc/ulp.hpp> #include <glm/gtc/ulp.hpp>
#include <iostream>
#include <limits> #include <limits>
int test_ulp_float_dist() int test_ulp_float_dist()

View File

@ -12,8 +12,7 @@
#include <glm/gtc/epsilon.hpp> #include <glm/gtc/epsilon.hpp>
#include <glm/gtx/euler_angles.hpp> #include <glm/gtx/euler_angles.hpp>
#include <glm/vector_relational.hpp> #include <glm/vector_relational.hpp>
#include <type_traits>
#include <iostream>
int myrand() int myrand()
{ {

View File

@ -13,7 +13,7 @@
#include <glm/gtc/epsilon.hpp> #include <glm/gtc/epsilon.hpp>
#include <glm/gtx/string_cast.hpp> #include <glm/gtx/string_cast.hpp>
#include <glm/gtx/euler_angles.hpp> #include <glm/gtx/euler_angles.hpp>
#include <iostream> #include <cstdio>
namespace test_eulerAngleX namespace test_eulerAngleX
{ {
@ -302,17 +302,17 @@ namespace test_eulerAngleYXZ
glm::fmat4 rotationInvertedY = glm::eulerAngleY(-1.f*first) * glm::eulerAngleX(second) * glm::eulerAngleZ(third); glm::fmat4 rotationInvertedY = glm::eulerAngleY(-1.f*first) * glm::eulerAngleX(second) * glm::eulerAngleZ(third);
glm::fmat4 rotationDumb = glm::fmat4(); glm::fmat4 rotationDumb = glm::fmat4();
rotationDumb = glm::rotate(rotationDumb, first, glm::fvec3(0,1,0)); rotationDumb = glm::rotate(rotationDumb, first, glm::fvec3(0,1,0));
rotationDumb = glm::rotate(rotationDumb, second, glm::fvec3(1,0,0)); rotationDumb = glm::rotate(rotationDumb, second, glm::fvec3(1,0,0));
rotationDumb = glm::rotate(rotationDumb, third, glm::fvec3(0,0,1)); rotationDumb = glm::rotate(rotationDumb, third, glm::fvec3(0,0,1));
std::cout << glm::to_string(glm::fmat3(rotationEuler)) << std::endl; std::printf("%s\n", glm::to_string(glm::fmat3(rotationEuler)).c_str());
std::cout << glm::to_string(glm::fmat3(rotationDumb)) << std::endl; std::printf("%s\n", glm::to_string(glm::fmat3(rotationDumb)).c_str());
std::cout << glm::to_string(glm::fmat3(rotationInvertedY )) << std::endl; std::printf("%s\n", glm::to_string(glm::fmat3(rotationInvertedY)).c_str());
std::cout <<"\nRESIDUAL\n"; std::printf("\nRESIDUAL\n");
std::cout << glm::to_string(glm::fmat3(rotationEuler-(rotationDumb))) << std::endl; std::printf("%s\n", glm::to_string(glm::fmat3(rotationEuler-(rotationDumb))).c_str());
std::cout << glm::to_string(glm::fmat3(rotationEuler-(rotationInvertedY ))) << std::endl; std::printf("%s\n", glm::to_string(glm::fmat3(rotationEuler-(rotationInvertedY))).c_str());
return 0; return 0;
} }

View File

@ -13,7 +13,6 @@
#include <glm/gtc/random.hpp> #include <glm/gtc/random.hpp>
#include <glm/gtx/simd_vec4.hpp> #include <glm/gtx/simd_vec4.hpp>
#include <glm/gtx/simd_mat4.hpp> #include <glm/gtx/simd_mat4.hpp>
#include <iostream>
#include <cstdio> #include <cstdio>
#include <ctime> #include <ctime>
#include <vector> #include <vector>

View File

@ -9,7 +9,6 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include <glm/gtx/string_cast.hpp> #include <glm/gtx/string_cast.hpp>
#include <iostream>
#include <limits> #include <limits>
int test_string_cast_vector() int test_string_cast_vector()
@ -132,8 +131,6 @@ int main()
Error += test_string_cast_vector(); Error += test_string_cast_vector();
Error += test_string_cast_matrix(); Error += test_string_cast_matrix();
printf("GNI");
return Error; return Error;
} }

View File

@ -9,7 +9,6 @@
#include <glm/gtc/constants.hpp> #include <glm/gtc/constants.hpp>
#include <glm/gtx/vector_angle.hpp> #include <glm/gtx/vector_angle.hpp>
#include <iostream>
#include <limits> #include <limits>
int test_angle() int test_angle()