From a14386ff1b05bccf4fef5ea3bb99c8be32a6e161 Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Sat, 24 Mar 2012 01:05:28 +0100 Subject: [PATCH] tests: added test-rdim --- src/adg/tests/.gitignore | 1 + src/adg/tests/Makefile.am | 4 ++++ src/adg/tests/test-rdim.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 src/adg/tests/test-rdim.c diff --git a/src/adg/tests/.gitignore b/src/adg/tests/.gitignore index 5f5bc092..fcb163a1 100644 --- a/src/adg/tests/.gitignore +++ b/src/adg/tests/.gitignore @@ -19,6 +19,7 @@ /test-marker /test-model /test-projection +/test-rdim /test-stroke /test-table /test-table-style diff --git a/src/adg/tests/Makefile.am b/src/adg/tests/Makefile.am index 3a264c81..00fe67da 100644 --- a/src/adg/tests/Makefile.am +++ b/src/adg/tests/Makefile.am @@ -77,6 +77,10 @@ TEST_PROGS+= test-ldim$(EXEEXT) test_ldim_SOURCES= test-ldim.c \ $(test_internals) +TEST_PROGS+= test-rdim$(EXEEXT) +test_rdim_SOURCES= test-rdim.c \ + $(test_internals) + TEST_PROGS+= test-adim$(EXEEXT) test_adim_SOURCES= test-adim.c \ $(test_internals) diff --git a/src/adg/tests/test-rdim.c b/src/adg/tests/test-rdim.c new file mode 100644 index 00000000..42833495 --- /dev/null +++ b/src/adg/tests/test-rdim.c @@ -0,0 +1,46 @@ +/* ADG - Automatic Drawing Generation + * Copyright (C) 2010,2011,2012 Nicola Fontana + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + + +#include "test-internal.h" + + +static void +_adg_test_value(void) +{ + AdgDim *dim; + const gchar *value; + + dim = ADG_DIM(adg_rdim_new()); + + /* Check the default value (other options are checked by test-dim */ + value = adg_dim_get_value(dim); + g_assert_cmpstr(value, ==, "R <>"); +} + + +int +main(int argc, char *argv[]) +{ + adg_test_init(&argc, &argv); + + adg_test_add_func("/adg/rdim/property/value", _adg_test_value); + + return g_test_run(); +} -- 2.11.4.GIT