File: test-cutout.c

package info (click to toggle)
gmobile 0.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 632 kB
  • sloc: ansic: 2,079; sh: 36; xml: 31; makefile: 10; javascript: 6
file content (44 lines) | stat: -rw-r--r-- 891 bytes parent folder | download | duplicates (2)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 * Copyright (C) 2022 The Phosh Developers
 *
 * SPDX-License-Identifier: GPL-3-or-later
 *
 * Author: Guido Günther <agx@sigxcpu.org>
 */

#define GMOBILE_USE_UNSTABLE_API
#include "gmobile.h"


static void
test_gm_cutout_bounding_box (void)
{
  char *path = "M455, 0 \
                V 79    \
                H 625   \
                V 0     \
                Z";
  g_autoptr (GError) err = NULL;
  GmCutout *cutout;
  const GmRect *rect;

  cutout = gm_cutout_new (path);
  g_assert_no_error (err);

  rect = gm_cutout_get_bounds (cutout);
  g_assert_cmpint (rect->x, ==, 455);
  g_assert_cmpint (rect->y, ==, 0);
  g_assert_cmpint (rect->width, ==, 170);
  g_assert_cmpint (rect->height, ==, 79);
}


gint
main (gint argc, gchar *argv[])
{
  g_test_init (&argc, &argv, NULL);

  g_test_add_func ("/Gm/cutout/bounding-box", test_gm_cutout_bounding_box);

  return g_test_run ();
}