| 467 | |
| 468 | |
| 469 | void MemTest() |
| 470 | |
| 471 | { |
| 472 | |
| 473 | ILimage *Image; |
| 474 | |
| 475 | char *Data; |
| 476 | |
| 477 | long FileLen; |
| 478 | |
| 479 | FILE *f = fopen("default1.tga", "rb"); |
| 480 | |
| 481 | |
| 482 | |
| 483 | if (f == NULL) |
| 484 | |
| 485 | return; |
| 486 | |
| 487 | |
| 488 | |
| 489 | fseek(f, 0, SEEK_END); |
| 490 | |
| 491 | FileLen = ftell(f); |
| 492 | |
| 493 | Data = new char[FileLen]; |
| 494 | |
| 495 | if (Data == NULL) { |
| 496 | |
| 497 | fclose(f); |
| 498 | |
| 499 | return; |
| 500 | |
| 501 | } |
| 502 | |
| 503 | fseek(f, 0, SEEK_SET); |
| 504 | |
| 505 | fread(Data, 1, FileLen, f); |
| 506 | |
| 507 | fclose(f); |
| 508 | |
| 509 | |
| 510 | |
| 511 | Image = ilLoadTargaL(Data, FileLen); |
| 512 | |
| 513 | ilSaveTarga("out/memtga.tga", Image, NULL); |
| 514 | |
| 515 | |
| 516 | |
| 517 | return; |
| 518 | |
| 519 | } |
| 520 | |
| 521 | |
| 522 |
no test coverage detected