| 150 | } |
| 151 | |
| 152 | void ILTest::TestilConvertImage() |
| 153 | { |
| 154 | ILuint MainImage = 0; |
| 155 | |
| 156 | ilGenImages(1, &MainImage); |
| 157 | ilBindImage(MainImage); |
| 158 | CHECK_NO_ERROR(); |
| 159 | |
| 160 | ilLoadImage(".\\Data\\Logo.png"); |
| 161 | |
| 162 | ILenum lDestFormat[6] = { |
| 163 | IL_RGB, |
| 164 | IL_RGBA, |
| 165 | IL_BGR, |
| 166 | IL_BGRA, |
| 167 | IL_LUMINANCE, |
| 168 | IL_COLOUR_INDEX, |
| 169 | }; |
| 170 | |
| 171 | ILenum lDestType[8] = { |
| 172 | IL_BYTE, |
| 173 | IL_UNSIGNED_BYTE, |
| 174 | IL_SHORT, |
| 175 | IL_UNSIGNED_SHORT, |
| 176 | IL_INT, |
| 177 | IL_UNSIGNED_INT, |
| 178 | IL_FLOAT, |
| 179 | IL_DOUBLE, |
| 180 | }; |
| 181 | |
| 182 | for (unsigned int i=0; i < 5; ++i) |
| 183 | for (unsigned int j=0; j < 8; ++j) |
| 184 | { |
| 185 | ilConvertImage(lDestFormat[i], lDestType[j]); |
| 186 | CHECK_NO_ERROR(); |
| 187 | } |
| 188 | |
| 189 | ilConvertImage(lDestFormat[5], lDestType[0]); |
| 190 | ilConvertImage(lDestFormat[5], lDestType[1]); |
| 191 | CHECK_NO_ERROR(); |
| 192 | |
| 193 | for (unsigned int j=2; j < 8; ++j) |
| 194 | { |
| 195 | ilConvertImage(lDestFormat[5], lDestType[j]); |
| 196 | CPPUNIT_ASSERT(ilGetError() == IL_INVALID_CONVERSION); |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | void ILTest::TestilSaveF() |
| 201 | { |
nothing calls this directly
no outgoing calls
no test coverage detected