Sfoglia il codice sorgente

Added mtk_tga Unit Test to makefile

Thomas Buck 11 anni fa
parent
commit
e15cae64c3
2 ha cambiato i file con 13 aggiunte e 1 eliminazioni
  1. 7
    0
      Makefile
  2. 6
    1
      src/mtk_tga.cpp

+ 7
- 0
Makefile Vedi File

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 Vedi File

512
     if (!mtk_image__tga_check(f))
512
     if (!mtk_image__tga_check(f))
513
     {
513
     {
514
       if (!mtk_image__tga_load(f, &image, &width, &height, &type))
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
     fclose(f);
521
     fclose(f);
522
+  } else {
523
+      printf("Usage: %s testfile.tga\n", argv[0]);
519
   }
524
   }
520
 
525
 
521
   return 0;
526
   return 0;

Loading…
Annulla
Salva