History

integrates logging for interface

tosh committed 13 years ago

Commit 349e89a1 parent e78101713 files · +96 −89Browse files

Showing the changes to interface/src/Util.cpp (1 of 13 files). Show all

Unified · Split

interface/src/Util.cpp+18−17
@@ -13,6 +13,7 @@ · 12 unmodified lines
13#include <glm/glm.hpp>13#include <glm/glm.hpp>
14#include <SharedUtil.h>14#include <SharedUtil.h>
15 15
16#include "Log.h"
16#include "world.h"17#include "world.h"
17#include "Util.h"18#include "Util.h"
18 19
@@ -258,7 +259,7 @@ void renderOrientationDirections( glm::vec3 position, Orientation orientation, f · 239 unmodified lines
258}259}
259 260
260void testOrientationClass() {261void testOrientationClass() {
261 printf("\n----------\ntestOrientationClass()\n----------\n\n");262 printLog("\n----------\ntestOrientationClass()\n----------\n\n");
262 263
263 oTestCase tests[] = { 264 oTestCase tests[] = {
264 // - inputs ------------, outputs -------------------- ------------------- ----------------------------265 // - inputs ------------, outputs -------------------- ------------------- ----------------------------
@@ -297,43 +298,43 @@ void testOrientationClass() { · 32 unmodified lines
297 glm::vec3 up = o1.getUp();298 glm::vec3 up = o1.getUp();
298 glm::vec3 right = o1.getRight();299 glm::vec3 right = o1.getRight();
299 300
300 printf("\n-----\nTest: %d - yaw=%f , pitch=%f , roll=%f \n\n",i+1,yaw,pitch,roll);301 printLog("\n-----\nTest: %d - yaw=%f , pitch=%f , roll=%f \n\n",i+1,yaw,pitch,roll);
301 302
302 printf(" +front.x=%f, front.y=%f, front.z=%f\n",front.x,front.y,front.z);303 printLog(" +front.x=%f, front.y=%f, front.z=%f\n",front.x,front.y,front.z);
303 if (front.x == tests[i].frontX && front.y == tests[i].frontY && front.z == tests[i].frontZ) {304 if (front.x == tests[i].frontX && front.y == tests[i].frontY && front.z == tests[i].frontZ) {
304 printf(" front vector PASSES!\n");305 printLog(" front vector PASSES!\n");
305 } else {306 } else {
306 printf(" front vector FAILED! expected: \n");307 printLog(" front vector FAILED! expected: \n");
307 printf(" front.x=%f, front.y=%f, front.z=%f\n",tests[i].frontX,tests[i].frontY,tests[i].frontZ);308 printLog(" front.x=%f, front.y=%f, front.z=%f\n",tests[i].frontX,tests[i].frontY,tests[i].frontZ);
308 passed = false;309 passed = false;
309 }310 }
310 311
311 printf(" +up.x=%f, up.y=%f, up.z=%f\n",up.x,up.y,up.z);312 printLog(" +up.x=%f, up.y=%f, up.z=%f\n",up.x,up.y,up.z);
312 if (up.x == tests[i].upX && up.y == tests[i].upY && up.z == tests[i].upZ) {313 if (up.x == tests[i].upX && up.y == tests[i].upY && up.z == tests[i].upZ) {
313 printf(" up vector PASSES!\n");314 printLog(" up vector PASSES!\n");
314 } else {315 } else {
315 printf(" up vector FAILED! expected: \n");316 printLog(" up vector FAILED! expected: \n");
316 printf(" up.x=%f, up.y=%f, up.z=%f\n",tests[i].upX,tests[i].upY,tests[i].upZ);317 printLog(" up.x=%f, up.y=%f, up.z=%f\n",tests[i].upX,tests[i].upY,tests[i].upZ);
317 passed = false;318 passed = false;
318 }319 }
319 320
320 321
321 printf(" +right.x=%f, right.y=%f, right.z=%f\n",right.x,right.y,right.z);322 printLog(" +right.x=%f, right.y=%f, right.z=%f\n",right.x,right.y,right.z);
322 if (right.x == tests[i].rightX && right.y == tests[i].rightY && right.z == tests[i].rightZ) {323 if (right.x == tests[i].rightX && right.y == tests[i].rightY && right.z == tests[i].rightZ) {
323 printf(" right vector PASSES!\n");324 printLog(" right vector PASSES!\n");
324 } else {325 } else {
325 printf(" right vector FAILED! expected: \n");326 printLog(" right vector FAILED! expected: \n");
326 printf(" right.x=%f, right.y=%f, right.z=%f\n",tests[i].rightX,tests[i].rightY,tests[i].rightZ);327 printLog(" right.x=%f, right.y=%f, right.z=%f\n",tests[i].rightX,tests[i].rightY,tests[i].rightZ);
327 passed = false;328 passed = false;
328 }329 }
329 330
330 if (!passed) {331 if (!passed) {
331 printf("\n-----\nTest: %d - FAILED! \n----------\n\n",i+1);332 printLog("\n-----\nTest: %d - FAILED! \n----------\n\n",i+1);
332 failedCount++;333 failedCount++;
333 }334 }
334 }335 }
335 printf("\n-----\nTotal Failed: %d out of %d \n----------\n\n",failedCount,totalTests);336 printLog("\n-----\nTotal Failed: %d out of %d \n----------\n\n",failedCount,totalTests);
336 printf("\n----------DONE----------\n\n");337 printLog("\n----------DONE----------\n\n");
337}338}
338 339
339 340