Browse Source

Added mtk_tga Unit Test to makefile

Thomas Buck 10 years ago
parent
commit
e15cae64c3
2 changed files with 13 additions and 1 deletions
  1. 7
    0
      Makefile
  2. 6
    1
      src/mtk_tga.cpp

+ 7
- 0
Makefile View File

@@ -369,3 +369,10 @@ endif
369 369
 
370 370
 #################################################################
371 371
 
372
+TGA.test:
373
+	mkdir -p $(BUILD_TEST_DIR)
374
+	$(CC) $(TEST_FLAGS) -D__TEST_ \
375
+		src/mtk_tga.cpp -o $(BUILD_TEST_DIR)/TGA.test
376
+
377
+#################################################################
378
+

+ 6
- 1
src/mtk_tga.cpp View File

@@ -512,10 +512,15 @@ int main(int argc, char *argv[])
512 512
     if (!mtk_image__tga_check(f))
513 513
     {
514 514
       if (!mtk_image__tga_load(f, &image, &width, &height, &type))
515
-	delete [] image;
515
+      {
516
+        printf("Loaded %s successfully!\n", argv[1]);
517
+        delete [] image;
518
+      }
516 519
     }
517 520
 
518 521
     fclose(f);
522
+  } else {
523
+      printf("Usage: %s testfile.tga\n", argv[0]);
519 524
   }
520 525
 
521 526
   return 0;

Loading…
Cancel
Save