aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib/tests
AgeCommit message (Collapse)Author
2023-02-17libmm-glib,common-helpers: Add multiple apn-type managementFrederic Martinsons
Fixes #676 Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
2023-02-17libmm-glib,tests: extend tests for common helpers (string conversion)Frederic Martinsons
Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
2022-11-07build: drop autotoolsAleksander Morgado
2022-10-05libmm-glib,common-helpers: don't assume new_from_unix_utc() always succeedsAleksander Morgado
The g_date_time_new_from_unix_utc() method in glib2 may fail if the given timestamp is too far into the future. The value is supposed to be seconds since unix time origin, but internally it will be converted into usecs, so any value longer than G_MAXINT64 / USEC_PER_SECOND isn't allowed. This is currently used in the CLI, and we're anyway ignoring the error returned in that case, but at least it won't crash if it ever happens.
2022-04-08sms: prevent crash if date is out of rangeCarlo Lobrano
g_date_time_new, and g_date_time_new_utc return NULL if inputs are out of range, and currently mm_new_iso8601_time passes the GDateTime created by those two functions to date_time_format_iso8601 without checking for NULL values, causing a g_date_time_format_iso8601 crash if PDU data is corrupted with wrong date. To prevent this, mm_new_iso8601_time now can return NULL and set a new GError if GDateTime created by g_date_time_new is NULL. Fixes #546
2021-10-22cli, plugins: factorize usage of iso8601 datetime formatFrederic Martinsons
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com> Includes updates by Aleksander Morgado to fix coding style issues.
2021-09-07build: Port to mesonIñigo Martínez
meson is a build system focused on speed an ease of use, which helps speeding up the software development. This patch adds meson support along autotools.
2021-03-01libmm-glib,tests: include string.h explicitlyAleksander Morgado
For strlen()
2021-02-23libmm-glib,tests: add ishexstr/hexstr2bin/bin2hexstr unit testsAleksander Morgado
2020-01-31libmm-glib,helpers: allow \r\n in string to number conversionsAleksander Morgado
It's not uncommon that we may want to parse a simple AT response that contains a single number by doing mm_strip_tag() followed by mm_get_uint_from_str(). In order to do this, we need to have the helper methods that convert strings to numbers support \r\n characters at the end of the string, as we would have in AT responses.
2020-01-31libmm-glib,test: avoid using deprecated mm_pco_list_free()Aleksander Morgado
test-pco.c: In function ‘test_pco_list_add’: test-pco.c:82:5: warning: ‘mm_pco_list_free’ is deprecated [-Wdeprecated-declarations] 82 | mm_pco_list_free (list); | ^~~~~~~~~~~~~~~~ In file included from ../../libmm-glib/libmm-glib.h:82, from test-pco.c:17: ../../libmm-glib/mm-pco.h:67:6: note: declared here 67 | void mm_pco_list_free (GList *pco_list); | ^~~~~~~~~~~~~~~~
2018-11-08tests: use memcmp() instead of g_assert_cmpmem() for nowBen Chan
g_assert_cmpmem() isn't available until glib 2.46, while the minimum glib version required by ModemManager is 2.36. This patch replaces the uses of g_assert_cmpmem() with memcmp() instead.
2018-08-18libmm-glib,pco: add helpers for managing a list of MMPcoBen Chan
2017-02-03glib: remove invocations of g_type_init()Ben Chan
g_type_init() has been deprecated (and also marked with the attribute 'deprecated') since glib 2.36 as the type system is automatically initialized. Since the minimum version of glib required by ModemManager is 2.36, calling g_type_init() isn't necessarily in the ModemManager code.
2015-01-11build: add code coverage supportJakub Sitnicki
Build all targets, except for CLI tools (mmcli, uml290), with special flags needed for collecting code coverage information when the build has been configured with --enable-code-coverage. Three new targets are available in the top build directory: - `check-code-coverage' runs the test suite and generates a code coverage report, - `code-coverage-capture' generates a code coverage report from already collected data, which can come in handy when one wants to see code paths touched by a particular test, - `code-coverage-clean' removes the collected coverage data and the generated reports.
2013-06-18build: setup gtester based testsAleksander Morgado
2012-10-04libmm-glib: don't install the common helpers headerAleksander Morgado
And make it only available for internal ModemManager compilation.
2012-10-04libmm-glib: remove the `libmm-common.h' headerAleksander Morgado
Both the ModemManager daemon and the mmcli will now include `libmm-glib.h' only. We also handle two new special `_LIBMM_INSIDE_MM' and `LIBMM_INSIDE_MMCLI' symbols, which if included before the `libmm-glib.h' library allow us to: * Don't include the libmm-glib high level API in the ModemManager daemon, as the object names would clash with those in the core. * Define some of the methods of helper objects to be included only if compiling ModemManager daemon or the mmcli.
2012-10-04build: merge libmm-common into libmm-glibAleksander Morgado
It's pointless to have libmm-common around, just merge it into libmm-glib and make ModemManager depend on libmm-glib directly. At the end, the non-common stuff in libmm-glib is really minimal.