| 1 |
/** |
| 2 |
* Test that rendering an empty string does not fail |
| 3 |
* |
| 4 |
* Rendering an empty string with gdImageStringFT() is not supposed to fail; |
| 5 |
* it is just a no-op. |
| 6 |
* |
| 7 |
* See <https://github.com/libgd/libgd/issues/615> |
| 8 |
*/ |
| 9 |
|
| 10 |
#include "gd.h" |
| 11 |
#include "gdtest.h" |
| 12 |
|
| 13 |
int main() |
| 14 |
{ |
| 15 |
gdImagePtr im = gdImageCreate(100, 100); |
| 16 |
|
| 17 |
int rect[8]; |
| 18 |
int fg = gdImageColorAllocate(im, 255, 255, 255); |
| 19 |
char *path = gdTestFilePath("freetype/DejaVuSans.ttf"); |
| 20 |
char *res = gdImageStringFT(im, rect, fg, path, 12, 0, 10, 10, ""); |
| 21 |
|
| 22 |
gdTestAssert(res == NULL); |
| 23 |
free(path); |
| 24 |
gdImageDestroy(im); |
| 25 |
return gdNumFailures(); |
| 26 |
} |