summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Glib: value_custom: Use callback functions with C linkageKjell Ahlstedt2023-03-311-0/+7
| | | | | | * glib/glibmm/value_custom.[cc|h]: Add custom_boxed_type_cpp_register(). * tests/glibmm_value/main.cc: Add test of copying custom Value. Part of issue #1
* Fix giomm_simple test on WindowsChun-wei Fan2023-01-051-0/+1
| | | | | | | | | | One normally cannot attempt to remove (delete) a file on Windows if it is still open, so we must close the resources that are tied to the file before attempting to delete it. Without doing so, the test program will fail on Windows as an exception is caught as the file->remove() call failed since the associated iostream is still open.
* Gio::File: Add create_tmp()Kjell Ahlstedt2022-09-011-4/+54
| | | | | | * gio/src/file.[ccg|hg]: Add create_tmp(). Document create_for_parse_name(). * tests/giomm_simple/main.cc: Test File::create_tmp().
* Gio::ListStore::find() docs: Small changesKjell Ahlstedt2022-09-011-3/+3
|
* Gio::ListStore: Add find()Kjell Ahlstedt2022-08-291-0/+72
| | | | | | * gio/src/liststore.[ccg|hg]: Add two ListStoreBase::find() and two ListStore::find(). * tests/giomm_listmodel/main.cc: Test ListStore::find().
* meson.build: Specify 'check' option in run_command()Kjell Ahlstedt2022-02-141-2/+0
| | | | | | The default value will be changed in future Meson releases. Don't use deprecated python3.path() and execute(..., gui_app: ...).
* Add Glib::Environ and tests/glibmm_environKjell Ahlstedt2021-05-233-0/+51
| | | | Fixes #89
* tests/glibmm_ustring_compare: Fix so it works for C++20Kjell Ahlstedt2021-04-112-28/+39
| | | | | | | Make 3 tests, where the 2 new tests check that the disallowed comparisons between std::string and Glib::ustring don't compile. The new tests are added only in Meson builds (ninja test). See MR !50
* Meson build: No implicit_include_directoriesKjell Ahlstedt2021-04-081-0/+1
|
* Meson build: Make it possible to use glibmm as a subprojectKjell Ahlstedt2021-03-121-2/+2
| | | | glib and sigc++ can be subprojects of glibmm.
* Meson build: examples and tests: Add dependency('threads')Kjell Ahlstedt2021-03-121-1/+6
| | | | | | Multithreaded examples and tests depend on 'threads'. I noticed this when I started experimenting with subprojects. Strange that it was not reported as a missing dependency long ago.
* tests/glibmm_tls_client: Skip test, if socket can't be connectedKjell Ahlstedt2020-12-101-1/+4
| | | | | This test sometimes fails in CI runs, probably for a reason that's out of glibmm's control.
* tests/glibmm_tls_client: Catch exceptions from more function callsKjell Ahlstedt2020-12-091-6/+18
| | | | | Gio::Socket::create() can throw an exception. Put it in a try block. See #84
* Remove Glib::BalancedTreeKjell Ahlstedt2020-09-074-235/+0
| | | | Use std::map or std::unordered_map instead.
* tests/glibmm_buildfilename: Add some testsKjell Ahlstedt2020-03-201-0/+25
| | | | See issue #71
* examples, tests: Disable deprecated API when building with MesonKjell Ahlstedt2020-03-091-0/+1
| | | | | Deprecated GLIBMM and GIOMM API are disabled when example programs and test programs are built with Autotools. Do the same when building with Meson.
* Activate the glibmm_ustring_compose testKjell Ahlstedt2020-03-042-6/+8
| | | | | It was (probably by mistake) disabled by commit 729b1ae95d5d05b78741eeef1d635f95b19d790b
* glibmm_interface_move test: Avoid warnings in test_IFace_get_type()Chun-wei Fan2020-03-021-0/+2
| | | | | | ...for Visual Studio builds, since we don't really get unused function warnings from the TEST_IFACE items. Plus, we don't have glib autoptr support in Visual Studio builds, either.
* Add support for building glibmm with MesonKjell Ahlstedt2020-03-011-0/+62
| | | | | | glibmm can be built with either Autotools or Meson. See MR !27
* Glib::Binding: Keep a binding alive even without a RefPtrKjell Ahlstedt2019-12-151-4/+9
| | | | | | | | A binding between properties can remain even after all RefPtr<Binding>s are gone. This is similar to how Gtk::Widget::set_controller() works in gtkmm4. Fixes #62, see !21
* Derive Glib::Error from std::exception, remove Glib::ExceptionKjell Ahlstedt2019-12-143-4/+4
| | | | | | Glib::Error::what() returns const char* (was Glib::ustring). It overrides std::exception::what() that returns const char* and is noexcept. Fixes #23
* Use Glib::UStringView with Glib::ustring::compare()Thomas Holder2019-11-302-1/+117
| | | | | | | | and with the comparison operators, operator==(), etc. Add the glibmm_ustring_compare test case. https://gitlab.gnome.org/GNOME/glibmm/issues/64 https://gitlab.gnome.org/GNOME/glibmm/issues/65
* Glib::Regex: Use UStringViewThomas Holder2019-11-212-0/+30
| | | | Fixes #66
* Avoid unnecessary conversions between std::string and Glib::ustringKjell Ahlstedt2019-11-181-1/+1
| | | | | A few implicit conversions in tests/ have been kept. They are probably deliberate, to test implicit conversion. Inspired by issue #65
* tests/glibmm_binding: Add basic test inc transformDaniel Boles2019-11-092-0/+108
| | | | | A basic test is better than nothing, and I just changed how the transform function works and want to be confident it still does.
* ustring: Add sprintf(), wrapping g_strdup_printf()Daniel Boles2019-06-202-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | Add another way to produce formatted ustrings, this time using printf syntax, by forwarding arguments to g_strdup_printf() and then copying the result into the returned ustring. This includes a private ustring::sprintify() function that by default just forward its argument but can be overloaded to do something else. In this commit, that is overloaded for ustring and std::string so that their .c_str() is passed to printf instead, avoiding the ugliness of users always having to write .c_str() in their own lists of arguments. Note that the same lack of type safety as plagues printf() and all its variants (in both C and GLib) applies here: the arguments are just forwarded on, so if you include too few or the wrong types for the placeholders you specify, you invoke undefined behaviour just as in C. For reasons like that, C++'s preference of streams over stdio, and the hope that we'll eventually get an actual nice string-formatting solution in the C++ Standard, I don't go out of my way to shout about this in the documentation. Users who really want sprintf() will find it, without us having to shout too loudly about it and risk being seen as recommending it more than anything else. It's here for those who know they need it. https://gitlab.gnome.org/GNOME/glibmm/issues/21
* Gio::AsyncResult: Explain why wrap() is not used in get_source_object_base()Kjell Ahlstedt2019-01-251-1/+16
| | | | | | * gio/src/asyncresult.ccg: Replace a TODO comment with an explanation. * tests/giomm_asyncresult_sourceobject/main.cc: Add code that demonstrates why Glib::wrap(GObject* object, bool take_copy) returns an empty RefPtr.
* tests/glibmm_ustring_format: Fix non-English langsKjell Ahlstedt2018-10-241-0/+4
| | | | | | | | | | | >>> when I tested it, the glibmm_ustring_format test failed. It failed because my chosen language in Ubuntu is Swedish. The expected "42.00" became "42,00". The decimal delimiter is a comma in most European languages. English is an exception. >>> https://gitlab.gnome.org/GNOME/glibmm/merge_requests/4#note_352960
* tests/glibmm_ustring_format: Test output, iomanipsDaniel Boles2018-10-141-0/+22
| | | | | | | | | We only tested here whether single arguments got formatted without throwing exceptions, but not whether they got formatted into the expected output or combinations of multiple types and I/O manipulators. This adds a test for that, so we at least have something to ensure that things are working correctly, e.g. if refactoring format() as I just did
* Avoid compiler warnings from function pointer conversionsKjell Ahlstedt2018-08-311-2/+2
| | | | | | | | | | | | | | gcc8 -Wextra prints a warning when a single reinterpret_cast is used for conversion between different types of function pointers. The previous fix with a union in Glib::bitwise_equivalent_cast<>() is not standard C++. Rename the function to Glib::function_pointer_cast<>(), and use two reinterpret_casts as recommended in gcc's documentation. * glib/src/optiongroup.ccg: Use a reinterpret_cast to convert from a function pointer to void*. That's possible now. It's "conditionally supported", starting with C++11. See https://github.com/libsigcplusplus/libsigcplusplus/issues/8
* Avoid compiler warnings from function pointer conversionsKjell Ahlstedt2018-07-172-3/+3
| | | | | | | | | | | | gcc8 -Wextra prints a warning when reinterpret_cast is used for conversion between different types of function pointers. Avoid that by adding Glib::bitwise_equivalent_cast<>() with a union with members of the two types of function pointers. * glib/src/optiongroup.ccg: Use Glib::bitwise_equivalent_cast<>() to convert from a function pointer to void*. See https://github.com/libsigcplusplus/libsigcplusplus/issues/1
* Revert "Avoid compiler warnings from function pointer conversions"Kjell Ahlstedt2018-07-172-12/+3
| | | | | | This reverts commit fa85bd1161d5d914095d1a3f9b620da294c9af79. This can be done in a better way by keeping the union in a template function.
* Avoid compiler warnings from function pointer conversionsKjell Ahlstedt2018-07-132-3/+12
| | | | | | | | gcc8 -Wextra prints a warning when reinterpret_cast is used for conversion between different types of function pointers. Avoid that by instead using a union with members of the two types of function pointers. See https://github.com/libsigcplusplus/libsigcplusplus/issues/1
* Revert "Try to disable -Wunused-function for the glibmm_interface_move test."Murray Cumming2018-04-221-4/+1
| | | | | | This reverts commit 732df7d9cb709f6fd96099654fb83a00d99f26cf. This doesn't seem to be a problem any more.
* tests/glibmm_variant: Test operator==() and operator!=()Kjell Ahlstedt2017-11-141-0/+33
| | | | Bug 789330
* Update the Free Software Foundation address in copyright noticesKjell Ahlstedt2017-08-303-6/+3
| | | | Bug 786824
* Glib::Variant: Improved support for D-Bus object paths and signaturesKjell Ahlstedt2017-08-161-3/+52
| | | | | | | | | | | | | | * glib/glibmm/filelist.am: Add variantdbusstring.h and variantdbusstring.cc. * glib/glibmm/variantdbusstring.[cc|h]: New files. String classes meant only for Variants with D-Bus object paths or D-Bus signatures. * glib/src/variant.[ccg|hg]: Add specializations for Variant<Glib::DBusObjectPathString>, Variant<Glib::DBusSignatureString> and Variant<std::vector<Glib::DBusObjectPathString>>. * glib/src/varianttype.[ccg|hg]: Add VARIANT_TYPE_OBJECT_PATH_ARRAY. * tests/glibmm_variant/main.cc: Add test_object_path(). Make it possible to create a composite Variant containing variant type o (D-Bus object path) or g (D-Bus signature). Bug 785700
* tests: Activate the glibmm_object testKjell Ahlstedt2017-07-032-3/+6
| | | | Probably overlooked in commit 696685eeaa639ae5e41a9eaa761250368af492db
* tests/Makefile.am: Remove the last remnants of glibmm_weakrefKjell Ahlstedt2017-07-031-2/+0
| | | | to avoid some warnings when Makefile is generated from Makefile.am.
* tests: Avoid an unused function warnings from G_DECLARE_INTERFACE().Murray Cumming2017-05-261-0/+7
|
* tests/Makefile.am: Fix a typo to fix the build.Murray Cumming2017-04-261-3/+4
|
* Glib::SignalProxy: Make a specialization for void signal handlersKjell Ahlstedt2017-04-231-1/+1
| | | | | | | Make specializations of SignalProxy<> and SignalProxyDetailed<> for signal handlers that return void. The specializations have no connect_notify() method, and the 'after' parameter in the connect() method has a default value only in the specializations. Bug 126213
* NodeTree: Move enums into class, and use C++11 enum classes.Murray Cumming2017-04-181-18/+18
|
* Gio::Socket: Move enums into class.Murray Cumming2017-04-181-1/+1
|
* Value: Only use RefPtr specialization for types that have get_base_type().Murray Cumming2017-04-151-0/+27
| | | | | | | | For instance, RefPtr to ObjectBase-derived types, or other types that try to have a similar API. Previously, this assumed that any Value<RefPtr<T>> was for a T that had a get_base_type() (wrapping an underlying glib/gtk C type).
* Fix make check when _WRAP_ENUM generates enum classKjell Ahlstedt2017-04-112-3/+3
| | | | Bug 86864
* tests: glibmm_value: Test RefPtr-to-ObjectBase.Murray Cumming2017-04-091-0/+40
|
* tests: Split object_move and objectbase_move tests.Murray Cumming2017-04-097-113/+152
| | | | This allows further reuse of the DerivedObject and DerivedObjectBase test classes.
* tests: glibmm_value: Actually test set/get().Murray Cumming2017-04-071-11/+61
|
* tests: glibmm_value: Actually call the test function.Murray Cumming2017-04-071-1/+3
|