diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 13 | ||||
-rw-r--r-- | tests/OffscreenContext.cc | 2 | ||||
-rw-r--r-- | tests/OffscreenContextWGL.cc | 9 | ||||
-rw-r--r-- | tests/cgalpngtest.cc | 5 | ||||
-rw-r--r-- | tests/csgtestcore.h | 5 | ||||
-rw-r--r-- | tests/lodepng.h | 6 | ||||
-rw-r--r-- | tests/yee_compare.h | 8 |
7 files changed, 26 insertions, 22 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 593fa1b..35818de 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -27,11 +27,6 @@ if(WIN32_STATIC_BUILD) endif() endif() -# Turn off Eigen SIMD optimization -if(WIN32) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DEIGEN_DONT_ALIGN") -endif() - # Disable warnings if(WIN32) # too long decorated names @@ -53,8 +48,6 @@ if(WIN32) # you have to pass -DCMAKE_VERBOSE_MAKEFILE=ON to cmake when you run it. endif() -# Compilation debugging - # # Build test apps @@ -71,6 +64,12 @@ find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL REQUIRED) include(${QT_USE_FILE}) # Eigen2 + +# Turn off Eigen SIMD optimization +if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DEIGEN_DONT_ALIGN") +endif() + if (NOT EIGEN2_INCLUDE_DIR) find_path(EIGEN2_INCLUDE_DIR Eigen/Core diff --git a/tests/OffscreenContext.cc b/tests/OffscreenContext.cc index f5eabe0..c50097f 100644 --- a/tests/OffscreenContext.cc +++ b/tests/OffscreenContext.cc @@ -197,7 +197,7 @@ OffscreenContext *create_offscreen_context(int w, int h) } // glewInit must come after Context creation and before FBO calls. - glewInit(); + GLenum err = glewInit(); if (GLEW_OK != err) { fprintf(stderr, "Unable to init GLEW: %s\n", glewGetErrorString(err)); exit(1); diff --git a/tests/OffscreenContextWGL.cc b/tests/OffscreenContextWGL.cc index b4170d1..f120384 100644 --- a/tests/OffscreenContextWGL.cc +++ b/tests/OffscreenContextWGL.cc @@ -71,9 +71,6 @@ bool create_wgl_dummy_context(OffscreenContext &ctx) // this function alters ctx->window and ctx->openGLContext // and ctx->dev_context if successfull - // stop Windows from producing dialog boxes about "this application has failed" - SetErrorMode(SEM_NOGPFAULTERRORBOX|SEM_NOOPENFILEERRORBOX|SEM_FAILCRITICALERRORS); - // create window HINSTANCE inst = GetModuleHandle(0); @@ -84,7 +81,7 @@ bool create_wgl_dummy_context(OffscreenContext &ctx) wc.hInstance = inst; wc.lpszClassName = "OpenSCAD"; RegisterClass( &wc ); - + HWND window = CreateWindow( "OpenSCAD", "OpenSCAD", WS_CAPTION | WS_POPUPWINDOW, //| WS_VISIBLE, 0, 0, ctx.width, ctx.height, NULL, NULL, inst, NULL ); @@ -133,7 +130,7 @@ bool create_wgl_dummy_context(OffscreenContext &ctx) bool mcok = wglMakeCurrent( dev_context, gl_render_context ); if (!mcok) { - cerr << "MS GDI - wglMakeCurrent failed\n"; + cerr << "MS WGL - wglMakeCurrent failed\n"; return false; } @@ -154,7 +151,6 @@ OffscreenContext *create_offscreen_context(int w, int h) // This call alters ctx->window and ctx->openGLContext // and ctx->dev_context if successfull if (!create_wgl_dummy_context( *ctx )) { - cerr << "wgl dummy fail\n"; fflush(stderr); return NULL; } @@ -169,7 +165,6 @@ OffscreenContext *create_offscreen_context(int w, int h) ctx->fbo = fbo_new(); if (!fbo_init(ctx->fbo, w, h)) { - cerr << "fbo didn't init\n"; return NULL; } diff --git a/tests/cgalpngtest.cc b/tests/cgalpngtest.cc index c72bc30..7f505a6 100644 --- a/tests/cgalpngtest.cc +++ b/tests/cgalpngtest.cc @@ -222,9 +222,8 @@ int main(int argc, char **argv) BoundingBox bbox; if (cgalRenderer.polyhedron) { CGAL::Bbox_3 cgalbbox = cgalRenderer.polyhedron->bbox(); - Vector3d min = Vector3d(cgalbbox.xmin(), cgalbbox.ymin(), cgalbbox.zmin()); - Vector3d max = Vector3d(cgalbbox.xmax(), cgalbbox.ymax(), cgalbbox.zmax()); - bbox = BoundingBox(min, max); + bbox = BoundingBox(Vector3d(cgalbbox.xmin(), cgalbbox.ymin(), cgalbbox.zmin()), + Vector3d(cgalbbox.xmax(), cgalbbox.ymax(), cgalbbox.zmax())); } else if (cgalRenderer.polyset) { bbox = cgalRenderer.polyset->getBoundingBox(); } diff --git a/tests/csgtestcore.h b/tests/csgtestcore.h index b988b21..330c894 100644 --- a/tests/csgtestcore.h +++ b/tests/csgtestcore.h @@ -1,3 +1,6 @@ +#ifndef CSGTESTCORE_H_ +#define CSGTESTCORE_H_ + enum test_type_e { TEST_THROWNTOGETHER, TEST_OPENCSG @@ -5,3 +8,5 @@ enum test_type_e { int csgtestcore(int argc, char *argv[], test_type_e test_type); +#endif + diff --git a/tests/lodepng.h b/tests/lodepng.h index 64ec2e3..a0a654f 100644 --- a/tests/lodepng.h +++ b/tests/lodepng.h @@ -1,3 +1,6 @@ +#ifndef LODEPNG_H_ +#define LODEPNG_H_ + /* LodePNG version 20110908 @@ -1891,3 +1894,6 @@ Account: lode dot vandevenne. Copyright (c) 2005-2011 Lode Vandevenne */ + +#endif + diff --git a/tests/yee_compare.h b/tests/yee_compare.h index 17b2e6f..041ae4c 100644 --- a/tests/yee_compare.h +++ b/tests/yee_compare.h @@ -1,4 +1,8 @@ +#ifndef _yee_compare_h +#define _yee_compare_h + // source code modified for OpenSCAD, Sept 2011 +// original copyright notice follows: /* Metric RGBAImage.h @@ -18,9 +22,6 @@ You should have received a copy of the GNU General Public License along with thi if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _yee_compare_h -#define _yee_compare_h - #include <string> class RGBAImage; @@ -123,4 +124,3 @@ protected: }; #endif - |