File: test-osd-window.c

package info (click to toggle)
phosh 0.53.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 9,936 kB
  • sloc: ansic: 83,383; xml: 3,981; python: 717; sh: 449; makefile: 34; lisp: 22; javascript: 6
file content (46 lines) | stat: -rw-r--r-- 1,259 bytes parent folder | download | duplicates (3)
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
45
46
/*
 * Copyright (C) 2022 Purism SPC
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 * Author: Guido Günther <agx@sigxcpu.org>
 */

#include "testlib-compositor.h"

#include "osd-window.h"

static void
test_osd_window_new (PhoshTestCompositorFixture *fixture, gconstpointer unused)
{
  GtkWidget *osd = g_object_new (PHOSH_TYPE_OSD_WINDOW,
                                 "monitor", phosh_test_get_monitor (fixture->state),
                                 "connector", "a-connector",
                                 "label", "a-label",
                                 "icon-name", "a-icon",
                                 "level", 0.5,
                                 "max-level", 1.0,
                                 NULL);
  g_assert_true (PHOSH_IS_OSD_WINDOW (osd));

  /* Flip some properties so we'd catch leaks with ASAN */
  g_object_set (osd,
                "connector", "b-connector",
                "label", "b-label",
                "icon-name", "b-icon",
                NULL);

  gtk_widget_set_visible (osd, TRUE);
  gtk_widget_destroy (osd);
}

int
main (int   argc,
      char *argv[])
{
  g_test_init (&argc, &argv, NULL);

  PHOSH_COMPOSITOR_TEST_ADD ("/phosh/osd-window/new", test_osd_window_new);

  return g_test_run ();
}