Branch data Line data Source code
1 : : /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- 2 : : * 3 : : * Copyright © 2018 Endless Mobile, Inc. 4 : : * 5 : : * This library is free software; you can redistribute it and/or 6 : : * modify it under the terms of the GNU Lesser General Public 7 : : * License as published by the Free Software Foundation; either 8 : : * version 2.1 of the License, or (at your option) any later version. 9 : : * 10 : : * This library is distributed in the hope that it will be useful, 11 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 : : * Lesser General Public License for more details. 14 : : * 15 : : * You should have received a copy of the GNU Lesser General Public 16 : : * License along with this library; if not, write to the Free Software 17 : : * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 : : * 19 : : * Authors: 20 : : * - Philip Withnall <withnall@endlessm.com> 21 : : */ 22 : : 23 : : #include <glib.h> 24 : : #include <libglib-testing/signal-logger.h> 25 : : #include <locale.h> 26 : : 27 : : 28 : : /* Test that creating and destroying a signal logger works. A basic smoketest. */ 29 : : static void 30 : 1 : test_signal_logger_construction (void) 31 : : { 32 : 1 : g_autoptr(GtSignalLogger) logger = NULL; 33 : 1 : logger = gt_signal_logger_new (); 34 : : 35 : : /* Call a method to avoid warnings about unused variables. */ 36 [ - + ]: 1 : g_assert_cmpuint (gt_signal_logger_get_n_emissions (logger), ==, 0); 37 : 1 : } 38 : : 39 : : int 40 : 1 : main (int argc, 41 : : char *argv[]) 42 : : { 43 : 1 : setlocale (LC_ALL, ""); 44 : : 45 : 1 : g_test_init (&argc, &argv, NULL); 46 : : 47 : 1 : g_test_add_func ("/signal-logger/construction", 48 : : test_signal_logger_construction); 49 : : 50 : 1 : return g_test_run (); 51 : : }