File: bug00615.c

package info (click to toggle)
libgd2 2.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 10,360 kB
  • sloc: ansic: 48,194; sh: 5,603; cpp: 1,298; makefile: 323; perl: 225; tcl: 45
file content (25 lines) | stat: -rw-r--r-- 582 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
 * Test that rendering an empty string does not fail
 *
 * Rendering an empty string with gdImageStringFT() is not supposed to fail;
 * it is just a no-op.
 * 
 * See <https://github.com/libgd/libgd/issues/615>
 */

#include "gd.h"
#include "gdtest.h"

int main()
{
    gdImagePtr im = gdImageCreate(100, 100);

    int rect[8];
    int fg = gdImageColorAllocate(im, 255, 255, 255);
    char *path = gdTestFilePath("freetype/DejaVuSans.ttf");
    char *res = gdImageStringFT(im, rect, fg, path, 12, 0, 10, 10, "");

    gdTestAssert(res == NULL);

    return gdNumFailures();
}