Commit Graph

5 Commits

Author SHA1 Message Date
Luca Bacci
8264b13737 tests/cxx: Do not assume that NULL is a pointer type starting with C++11
Many toolchain did not change the definition of NULL to avoid introducing
breaking changes in existing codebases. For example, on Windows NULL is
0 (int) regardless of the C++ standard in use.

Fixes the following warnings on CLang when compiling for Windows:

  ../glib/glib/tests/cxx.cpp:539:34: warning: missing sentinel in function call [-Wsentinel]
    g_test_init (&argc, &argv, NULL);
                                   ^
                                   , nullptr
  ../glib/glib/gtestutils.h:298:9: note: function has been explicitly marked sentinel here
  void    g_test_init                     (int            *argc,
          ^

  ../glib/gio/tests/cxx.cpp:62:34: warning: missing sentinel in function call [-Wsentinel]
    g_test_init (&argc, &argv, NULL);
                                   ^
                                   , nullptr
  ../glib/glib/gtestutils.h:298:9: note: function has been explicitly marked sentinel here
  void    g_test_init                     (int            *argc,
          ^
2023-10-12 11:45:03 +02:00
Markus Volk
caab1a41dc gio/tests/cxx.cpp: fix missing sentinel for musl
This fixes:
| ../glib-2.75.3/gio/tests/cxx.cpp: In function 'int main(int, char**)':
| ../glib-2.75.3/gio/tests/cxx.cpp:61:15: error: missing sentinel in function call [-Werror=format=]
|    61 |   g_test_init (&argc, &argv, NULL);

if built with musl libc

Signed-off-by: Markus Volk <f_l_k@t-online.de>
2023-02-23 15:02:26 +01:00
Marco Trevisan (Treviño)
23da6bade0 {glib,gio}/cxx: Add more tests for C++ inline funcs
These could behave differently in C++ so let's ensure this is not the
case.
2023-01-26 16:52:36 +01:00
Philip Withnall
26409f19cd Add SPDX license headers for LGPL-2.1-or-later to various files
These have all been added manually, as I’ve finished all the files which
I can automatically detect.

All the license headers in this commit are for LGPL-2.1-or-later, and
all have been double-checked against the license paragraph in the file
header.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #1415
2022-06-01 12:44:23 +01:00
Emmanuel Fleury
ae345e56c2 Distribute cxx test tests/cxx-test.cpp to each module tests directory
tests/cxx-test.cpp is removed and splitted into gio/tests/cxx.cpp,
gmodule/tests/cxx.cpp and gobject/tests/cxx.cpp.

Helps issue #1434
2021-12-14 14:43:03 +01:00