mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-29 04:14:11 +02:00
{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.
This commit is contained in:
@@ -349,6 +349,30 @@ test_strdup_macro (void)
|
||||
g_free (str);
|
||||
}
|
||||
|
||||
static void
|
||||
test_str_has_prefix (void)
|
||||
{
|
||||
g_assert_true ((g_str_has_prefix) ("C++ is cool!", "C++"));
|
||||
}
|
||||
|
||||
static void
|
||||
test_str_has_prefix_macro (void)
|
||||
{
|
||||
g_assert_true (g_str_has_prefix ("C++ is cool!", "C++"));
|
||||
}
|
||||
|
||||
static void
|
||||
test_str_has_suffix (void)
|
||||
{
|
||||
g_assert_true ((g_str_has_suffix) ("C++ is cool!", "cool!"));
|
||||
}
|
||||
|
||||
static void
|
||||
test_str_has_suffix_macro (void)
|
||||
{
|
||||
g_assert_true (g_str_has_suffix ("C++ is cool!", "cool!"));
|
||||
}
|
||||
|
||||
static void
|
||||
test_string_append (void)
|
||||
{
|
||||
@@ -473,6 +497,10 @@ main (int argc, char *argv[])
|
||||
g_test_add_func ("/C++/str-equal", test_str_equal);
|
||||
g_test_add_func ("/C++/strdup", test_strdup);
|
||||
g_test_add_func ("/C++/strdup/macro", test_strdup_macro);
|
||||
g_test_add_func ("/C++/str-has-prefix", test_str_has_prefix);
|
||||
g_test_add_func ("/C++/str-has-prefix/macro", test_str_has_prefix_macro);
|
||||
g_test_add_func ("/C++/str-has-suffix", test_str_has_suffix);
|
||||
g_test_add_func ("/C++/str-has-suffix/macro", test_str_has_suffix_macro);
|
||||
g_test_add_func ("/C++/string-append", test_string_append);
|
||||
|
||||
return g_test_run ();
|
||||
|
||||
Reference in New Issue
Block a user