Changeset 1914
- Timestamp:
- Sep 27, 2004, 3:24:46 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/image/tst_psImageManip.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImageManip.c
r1909 r1914 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-09-28 0 0:30:32$8 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-09-28 01:24:46 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 12 12 */ 13 13 14 14 15 #include <math.h> … … 601 602 psImage* img = NULL; 602 603 psImage* img2 = NULL; 604 psImage* img3 = NULL; 605 psImage* img4 = NULL; 603 606 unsigned int c = 128; 604 607 unsigned int r = 256; … … 700 703 } 701 704 } 705 img3 = psImageAlloc(c,r,PS_TYPE_S64); 706 for (unsigned row=0;row<r;row++) { 707 psS64* img3Row = img3->data.S64[row]; 708 for (unsigned col=0;col<c;col++) { 709 img3Row[col] = 6.0f; 710 } 711 } 712 img4 = psImageAlloc(c,r,PS_TYPE_S64); 713 for (unsigned row=0;row<r;row++) { 714 psS64* img4Row = img4->data.S64[row]; 715 for (unsigned col=0;col<c;col++) { 716 img4Row[col] = 2.0f; 717 } 718 } 702 719 703 720 psLogMsg(__func__,PS_LOG_INFO,"Following should error as overlay isn't " … … 756 773 757 774 /* 775 Verify the return integer is equal to non-zero and program execution 776 doesn't stop, if the specified operator is not =,+,-,*,/ 777 */ 778 779 psLogMsg(__func__,PS_LOG_INFO,"Following should error as operator is invalid"); 780 retVal = psImageOverlaySection(img,img2,0,0,"$"); 781 if (retVal == 0) { 782 psError(__func__,"psImageOverlaySection returned zero even though " 783 "overlay operator is invalid"); 784 return 8; 785 } 786 787 /* 788 Verify the return integer is equal to non-zero and program execution 789 doesn't stop, if the specified operator is NULL 790 */ 791 792 psLogMsg(__func__,PS_LOG_INFO,"Following should error as operator is invalid"); 793 retVal = psImageOverlaySection(img,img2,0,0,NULL); 794 if(retVal == 0) { 795 psError(__func__,"psImageOverlaySection returned zero even though " 796 "overlay operator is NULL"); 797 return 9; 798 } 799 800 /* 801 Verify the return integer is equal to non-zero and program execution 802 doesn't stop, if overlay image is a different type than the input image 803 */ 804 psLogMsg(__func__,PS_LOG_INFO,"Following should error as overlay is " 805 "a different type"); 806 retVal = psImageOverlaySection(img,img3,0,0,"+"); 807 if(retVal == 0) { 808 psError(__func__,"psImageOverlaySection returned zero eventhough " 809 " overlay image type is different than input image."); 810 return 10; 811 } 812 813 /* 814 Verify the return integer is equal to non-zero and program execution 815 doesn't stop, if invalid input and overlay images 816 */ 817 psLogMsg(__func__,PS_LOG_INFO,"Following should error as overlay and " 818 "image are not valid for the psImageOverlaySection function."); 819 retVal = psImageOverlaySection(img3,img4,0,0,"+"); 820 if(retVal == 0) { 821 psError(__func__,"psImageOverlaySection returned zero eventhough " 822 "overlay and image type are invalid type."); 823 return 11; 824 } 825 826 /* 758 827 Verify program execution doen't stop, if the overly image contains 759 828 zero values with division operation is specified. … … 769 838 psError(__func__,"psImageOverlaySection returned non-zero when " 770 839 "checking divide-by-zero."); 771 return 8;840 return 12; 772 841 } 773 842 774 843 psFree(img); 775 844 psFree(img2); 845 psFree(img3); 846 psFree(img4); 776 847 777 848 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.
