summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* tests: glibmm_value: Move code to main.ccMurray Cumming2017-04-073-35/+32
| | | | Which was previously almost empty.
* Remove Glib::WeakRefMurray Cumming2017-04-073-186/+10
| | | | | | | | | | | Now that RefPtr is really a std::shared_ptr<>, we should use std::weak_ref<> instead. Note that a std::weak_ptr<> tells you nothing about whether the underlying GObject is still alive, which Glib::RefPtr did. It just tells you whether our std::shared_ptr<> still holds a reference to it. That's why I removed one of the checks in tests/giomm_listmodel/main.cc.
* Use std::dynamic_pointer_cast<>().Murray Cumming2017-04-071-2/+2
| | | | Instead of Glib::RefPtr<>::cast_dynamic().
* glibmm_weakref: Don't try to use moved-from RefPtrs.Murray Cumming2017-04-071-15/+6
|
* RefPtr: Make this an alias for shared_ptr<> instead.Murray Cumming2017-04-072-17/+23
| | | | | | | | Specifying a Deleter in make_refptr_for_instance(). And changing RefPtr::cast_dynamic<>() to std::dynamic_pointer_cast<>(). The glibmm_refptr test then becomes rather silly, and should maybe just be removed.
* Add and use make_refptr_for_instance().Murray Cumming2017-04-063-3/+3
| | | | This will make it easier to change the underlying RefPtr type.
* Replace remaining uses of Glib::ArrayHandle<> with std::vector.Murray Cumming2017-03-173-145/+0
| | | | | | Using Glib::ArrayHandler<>::vector_to_array() and Glib::ArrayHandler<>::array_to_vector() instead, and only in the implementatoin instead of in the API.
* Added ustring::make_valid() which fixes non-UTF8 strings.Krzysztof Piecuch2017-03-152-1/+61
| | | | | | | | | | | make_valid replaces all non-UTF8 characters with replacement character (U+FFFD). Allows manipulating with ustring after you find out by ustring::validate() that it's not an UTF-8 string and you need to rescue it somehow. This wraps g_utf8_make_valid(). Bug #780075
* tests/glibmm_variant: Add test of Variant<std::tuple>Kjell Ahlstedt2017-03-061-1/+65
| | | | Bug 777791
* Tests: Initialize a member variable.Murray Cumming2016-12-121-1/+1
| | | | Noticed by cppcheck.
* Tests: Make single-parameter constructors explicit.Murray Cumming2016-12-124-4/+4
| | | | Noticed by cppcheck.
* Tests: Remove an unused variable.Murray Cumming2016-12-121-1/+0
| | | | Noticed by cppcheck.
* Add tests/giomm_stream_vfuncsKjell Ahlstedt2016-11-212-0/+174
| | | | | | | * tests/Makefile.am: Add giomm_stream_vfuncs. * tests/giomm_stream_vfuncs/main.cc: New file. An updated version of a patch by Krzysztof KosiƄski <tweenk.pl@gmail.com> Bug #572471
* Remove deprecated API.Murray Cumming2016-11-142-104/+0
|
* Try to disable -Wunused-function for the glibmm_interface_move test.Murray Cumming2016-11-111-1/+4
| | | | | | | | | | | | | | | | | | | To deal with this clang warning when building with --enable-warnings=fatal. TODO: However, this doesn't actually seem to disable the error. glibmm_interface_move/main.cc:9:1: error: unused function 'glib_autoptr_cleanup_TestIface' [-Werror,-Wunused-function] G_DECLARE_INTERFACE(TestIface, test_Iface, TEST, IFACE, GObject) ^ /opt/gnome/include/glib-2.0/gobject/gtype.h:1565:3: note: expanded from macro 'G_DECLARE_INTERFACE' _GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, PrerequisiteName) \ ^ /opt/gnome/include/glib-2.0/glib/gmacros.h:421:22: note: expanded from macro '_GLIB_DEFINE_AUTOPTR_CHAINUP' static inline void _GLIB_AUTOPTR_FUNC_NAME(ModuleObjName) (ModuleObjName **_ptr) { \ ^ /opt/gnome/include/glib-2.0/glib/gmacros.h:415:43: note: expanded from macro '_GLIB_AUTOPTR_FUNC_NAME' ^ <scratch space>:224:1: note: expanded from here glib_autoptr_cleanup_TestIface
* Add tests/giomm_listmodelKjell Ahlstedt2016-04-272-0/+353
| | | | | Similar to glib/gio/tests/glistmodel.c Bug #755307
* Examples: Use libsigc++ 2.9/10 and its slot/signal<R(Args...)> syntax.Murray Cumming2016-03-311-2/+2
| | | | The older libsigc++ syntax is deprecated.
* C++11: .h/.cc files: Replace typedefs with using.Murray Cumming2016-03-316-17/+17
|
* Fix "make check" after sigc::mem_fun(pointer,func) was deprecatedKjell Ahlstedt2016-03-101-2/+2
|
* Use std::ref instead of sigc::ref.Murray Cumming2016-03-081-9/+9
| | | | As required by the latest (not yet released) libsigc++.
* Re-run clang-format on some files.Murray Cumming2016-02-261-9/+9
| | | | | I need to make a subsequent commit to fix the now-unaligned trailing comments.
* Run clang-format on tests.Murray Cumming2016-02-2631-833/+810
|
* C++11: Use emplace_back() instead of push_back().Murray Cumming2016-02-051-2/+2
|
* C++11: Use initializer list instead of push_back() for initial single item.Murray Cumming2016-02-051-5/+2
|
* glibmm_mainloop test: Allocate a thread on the stack.Murray Cumming2015-11-261-5/+2
| | | | | As suggested by Kjell Ahlstedt: https://bugzilla.gnome.org/show_bug.cgi?id=757674#c10
* examples/tests: Use simpler std::thread constructor.Murray Cumming2015-11-261-5/+2
| | | | | Instead of using a lambda. As suggested by Kjell Ahlstedt: https://bugzilla.gnome.org/show_bug.cgi?id=757674#c10
* tests/glibmm_mainloop: Use the std::thread API instead of Glib::Threads.Murray Cumming2015-11-261-8/+14
|
* Tests: More nullptr instead of 0Kjell Ahlstedt2015-11-237-22/+29
|
* ObjectBase, Object, Interface: Fix move constructors and move assignmentsKjell Ahlstedt2015-10-313-23/+37
| | | | | | | | | | | | | | | | * glib/glibmm/interface.cc: Don't call ObjectBase's move assignment operator from Interface's move assignment operator. * glib/glibmm/object.cc: Perform of job of sigc::trackable's move constructor in Object's move constructor. * glib/glibmm/objectbase.cc: Move constructor: Set gobject_ = nullptr. Fix the assignment of cpp_destruction_in_progress_. Move assignment: Add self-assignment guard. Avoid the risk of accidentally deleting *this. Let a call to initialize_move() do most of the job. * tests/glibmm_interface_move/main.cc: * tests/glibmm_object_move/main.cc: * tests/glibmm_objectbase_move/main.cc: Really test move assignment. Test that the wrapped C object has been moved, and not copied. Bug #756962.
* Glib::WeakRef: Add noexceptKjell Ahlstedt2015-09-151-1/+0
| | | | | | | * glib/glibmm/weakref.h: Add noexcept. * glib/glibmm.h: Add weakref.h. * tests/glibmm_weakref/main.cc: Remove #include <glibmm/weakref.h>. Bug #583399.
* Add Glib::WeakRef<>Kjell Ahlstedt2015-09-152-0/+177
| | | | | | | | | | * glib/glibmm/filelist.am: Add weakref.h. * glib/glibmm/weakref.h: New file. * glib/glibmm.h: Add weakref.h. (Not yet. I'll do it before I push weakref.h.) * tests/Makefile.am: Add test case glibmm_weakref. * tests/glibmm_weakref/main.cc: New test case. Bug #583399. Thanks to worknesday, who attached a first version of WeakRef to the bug report. Bug #583399
* tests: Add glibmm_interface_move.Murray Cumming2015-08-222-0/+294
| | | | | | | | | | | | | | | | | This code got unpleasantly big because I wanted to test a C++ class that wraps a GObject while also implementing a C++ Interface that wraps a GInterface that the GObject implements. But it seems to work. However, the code to test a raw TestInterface is commented out because the move constructor does not pass the test. I am not sure if this should even be expected to work: Interface interface = std::move(object); or: Base base = std::move(derived); Surely that would lose the data (and virtual method table) from the Derived class anyway?
* tests: Split glibmm_object_move into 2 files.Murray Cumming2015-08-223-9/+155
| | | | To test ObjectBase separately.
* Add simple test for Object move.Murray Cumming2015-08-222-0/+50
|
* tests/glibmm_refptr: Add simpler tests for move constructor/operator=.Murray Cumming2015-07-281-1/+28
| | | | | | The *with_parent* tests test much the same thing, but these ones are simpler, based on Marcin Kolny's simpler tests for the universal reference versions.
* tests/glibmm_refptr: Slight improvement.Murray Cumming2015-07-281-1/+1
| | | | | test_refptr_universal_reference_move_constructor(): Make even more sure that its the copy constructor that the compiler uses.
* Glib::RefPtr: add missing constructor and assignment operatorMarcin Kolny2015-07-271-0/+33
| | | | | | | | * glib/glibmm/refptr.h: add move constructor and move assignment operator which allow to set underlying object to castable type. * tests/glibmm_refptr/main.cc: add tests for move constructor and move assignment operator containing universal reference as an argument.
* tests/glibmm_refptr: Correct the move constructor test.Murray Cumming2015-07-271-2/+2
| | | | | The && was const, which was a silly typo. Thanks to Marcin Kolny for noticing.
* Add tests/glibmm_refptr.Murray Cumming2015-07-272-0/+217
| | | | | To test refcounting, though I'm not sure that the test for the move constructor is quite right.
* tls_client test: Use gnome.org instead of google.orgMurray Cumming2015-07-271-1/+1
| | | | | | | | | | | Because I recently find that the connection often, but not always, times out. Maybe Google has changed something about its servers. I was seeing this output when running the test: $ ./giomm_tls_client/test Successfully resolved address of test host 'www.google.com'. First address of test host is 2a00:1450:4016:802::1011. Could not connect socket to 2a00:1450:4016:802::1011:443. Exception: Connection timed out
* Correct a comment.Murray Cumming2015-07-271-1/+0
|
* C++11: Use nullptr.Murray Cumming2015-07-162-4/+4
|
* C++11: examples/tests: More use of auto.Murray Cumming2015-07-159-45/+45
|
* C++11: More uses of range-based for.Murray Cumming2015-07-151-8/+6
|
* Avoid shadowed variables.Murray Cumming2015-07-153-12/+9
| | | | | | | | | | Because this generally invites programming errors, though I am less concerned about shadowing of method names by parameter or variable names, which requires some tedious parameter renaming. In MatchInfo::set_gobject() the confusion between take_ownership and this.take_ownership does seem to have caused a programming error, hopefully now corrected.
* C++11: Use the override keyword.Murray Cumming2015-07-151-3/+3
|
* Glib::Variant: Improve handling of object paths and signaturesKjell Ahlstedt2015-04-131-0/+59
| | | | | | | | | | * glib/src/variant.[ccg|hg]: Add VariantBase::is_castable_to() and VariantContainerBase::get_iter(). Accept casts of complicated types containing object paths and DBus type signatures to Variant<> types containing Glib::ustring and std::string. Change some get(), get_child() and get_iter() methods similarly. * tests/glibmm_variant/main.cc: Add test_dynamic_cast_composite_types(). Bug #747508.
* Improve tests/glibmm_interface_implementationKjell Ahlstedt2015-03-171-4/+44
| | | | | * tests/glibmm_interface_implementation/main.cc: Return EXIT_FAILURE if some test fails. Add more tests of virtual functions. Bug #705124.
* tests/giomm_tls_client: Put try/catch around Socket::connect().Murray Cumming2014-12-031-1/+11
| | | | Because it's currently timing out for me.
* Make giomm tests Run Under WindowsChun-wei Fan2014-09-172-2/+14
| | | | | | | | | | | | | | | /etc/fstab is a *nix only file, which would not normally exist under Windows unless one is under Cygwin. Use the path for the Wordpad application on Windows, which is a standard part of Windows; and use /etc/fstab otherwise. * tests/giomm_ioerror/main.cc: * tests/giomm_simple/main.cc: Test for c:/windows/write.exe (Wordpad application) on Windows, and use /etc/fstab otherwise. https://bugzilla.gnome.org/show_bug.cgi?id=736778 https://bugzilla.gnome.org/show_bug.cgi?id=736778