Commit Graph

74 Commits

Author SHA1 Message Date
Beniamino Galvani
8682bb7f5f nmtst: introduce nmtst_setting_ip_config_add_{address,route} helpers 2016-02-11 21:57:09 +01:00
Dan Williams
1fd91056d4 build: define g_assert_cmpmem() for glib < 2.46
Fixes: b73c0e2f6d
2016-02-11 12:40:18 -06:00
Thomas Haller
dc394a6537 macros: add NM_IN_STRSET()
Add macro similar to NM_IN_SET() that checks for C strings.
NULL values are allowed and handled as one would expect.
2016-02-11 17:54:38 +01:00
Thomas Haller
1211b5b631 macros: simplify NM_IN_SET() macro
Also fix NM_IN_SET_SE() to guaranteed return 0 or 1.
2016-02-11 17:54:38 +01:00
Dan Williams
80d9a43a25 tests: get rid of FAIL macro 2016-02-11 09:50:29 -06:00
Thomas Haller
c1470a353c nmtst: drop details argument from add-test helper 2016-02-10 00:15:41 +01:00
Thomas Haller
03ec751402 nmtst: fix nmtst_test_data_unpack() macro
Fixes: e6244814eb
2016-02-09 10:51:33 +01:00
Thomas Haller
e6244814eb nmtst: add nmtst_add_test_func() helper to schedule tests with arguments 2016-02-03 15:27:52 +01:00
Thomas Haller
9fda0817ab nmtst: don't use G_STRLOC in test functions
Instead pass separate values for file and line. Otherwise, we create
a unique string for each occurance.
2016-02-03 13:34:38 +01:00
Thomas Haller
123747963a nmtst: improve test macros FAIL() and ASSERT()
Fail only printed a message to stderr and exited.
Instead, print it with g_error(), which also breaks
in the debugger and produces a core-dump.

Also, it constructed the message based on an unchecked
format string and constructed a format string dynamically.
Just don't do that.

Also add a comment that these macros are discouraged because
they are cumbersome to write (requiring a test-name and a failure
message).
2016-02-03 12:41:35 +01:00
Thomas Haller
0bedc637ed build: add "shared" files to EXTRA_DIST 2016-01-27 11:51:17 +01:00
Thomas Haller
f427909bf8 shared: add NM_GOBJECT_PROPERTIES_DEFINE()
Helper macros to define GObject property enum,
the obj_properties array, and a _notify() function.

We should move away from invoking property changed notifications by
string, as we already do for signals. This macro simplifies the
implementation of establishes a pattern for naming and usage.
2016-01-19 21:20:36 +01:00
Beniamino Galvani
f96abc8be5 core: always use gulong to store signal handler ids
We inconsistently use gulong,guint,int types to store signal handler
id, but the type returned by g_signal_connect() is a gulong.

This has no practical consequences because a int/guint is enough to
store the value, however it is better to use a consistent type, also
because nm_clear_g_signal_handler() accepts a pointer to the signal id
and thus it must be always called with the same pointer type.
2016-01-06 21:25:55 +01:00
Thomas Haller
142ea41cae libnm/tests: add test code driving python test service 2015-12-26 16:43:49 +01:00
Thomas Haller
570d24b88c libnm/tests: add dbus-glib support to "nm-test-libnm-utils" 2015-12-26 16:43:49 +01:00
Thomas Haller
5edd265c0b libnm/tests: add nmtstc_nm_remote_settings_new() 2015-12-26 16:43:49 +01:00
Thomas Haller
56880fbe69 libnm/tests: add nmtstc_nm_client_new() 2015-12-26 16:43:49 +01:00
Thomas Haller
bdfcf02da3 libnm/tests: add NMTSTC_SERVICE_INFO_SETUP() macro 2015-12-26 16:43:49 +01:00
Thomas Haller
f354d5f0fc nmtst: enable connection utility functions for libnm-glib/libnm-utils library 2015-12-25 20:36:43 +01:00
Thomas Haller
9a11577e63 nmtst: add nmtst_uuid_generate() 2015-12-25 20:36:43 +01:00
Thomas Haller
c2bafa6153 nmtst: add nmtst_find_all_indexes() 2015-12-25 20:36:43 +01:00
Thomas Haller
766f31507b nmtst: add nmtst_main_loop_run() 2015-12-25 20:36:43 +01:00
Thomas Haller
c7d4d67d53 include: remove trailing semicolon from _Pragma() call 2015-12-24 11:42:37 +01:00
Thomas Haller
db80ec05ab build: rename directory "include" to "shared"
Up to now, the "include" directory contained (only) header files that were
used project-wide by libs, core, clients, et al.

Since the directory now also contains a non-header file, the "include"
name is misleading. Instead of adding yet another directory that is
project-wide, with non-header-only content, rename the "include"
directory to "shared".
2015-12-24 11:42:37 +01:00