1/*
2 * Copyright (C) 2011 Canonical Inc.
3 *
4 * Author:
5 * Michael Terry <michael.terry@canonical.com>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <gtk/gtk.h>
22
23static void
24gtk_css_provider_load_data_not_null_terminated (void)
25{
26 GtkCssProvider *p;
27 const char data[3] = {'*', '{', '}'};
28
29 p = gtk_css_provider_new();
30
31 gtk_css_provider_load_from_data(css_provider: p, data, length: sizeof (data));
32
33 g_object_unref (object: p);
34}
35
36
37int
38main (int argc, char *argv[])
39{
40 gtk_test_init (argcp: &argc, argvp: &argv, NULL);
41
42 g_test_add_func (testpath: "/gtk_css_provider_load_data/not_null_terminated",
43 test_func: gtk_css_provider_load_data_not_null_terminated);
44
45 return g_test_run ();
46}
47
48

source code of gtk/testsuite/css/api.c