From d17e93e69635e4bfc66a480d2ee18b0c56cdc887 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Sat, 29 Jun 2019 06:42:15 +0200 Subject: [PATCH 1/2] tests: undef G_DISABLE_ASSERT Since GLib 2.58, g_test_init started to be no-op if a test is compiled with G_DISABLE_ASSERT defined. --- egg/test-dh.c | 2 ++ egg/test-hex.c | 2 ++ egg/test-hkdf.c | 4 ++++ egg/test-secmem.c | 2 ++ libsecret/test-attributes.c | 2 ++ libsecret/test-collection.c | 2 ++ libsecret/test-item.c | 2 ++ libsecret/test-methods.c | 2 ++ libsecret/test-password.c | 2 ++ libsecret/test-paths.c | 2 ++ libsecret/test-prompt.c | 2 ++ libsecret/test-service.c | 2 ++ libsecret/test-session.c | 2 ++ libsecret/test-value.c | 2 ++ 14 files changed, 30 insertions(+) diff --git a/egg/test-dh.c b/egg/test-dh.c index 46fbc27..7befadd 100644 --- a/egg/test-dh.c +++ b/egg/test-dh.c @@ -22,6 +22,8 @@ #include "config.h" +#undef G_DISABLE_ASSERT + #include "egg/egg-dh.h" #include "egg/egg-secure-memory.h" #include "egg/egg-testing.h" diff --git a/egg/test-hex.c b/egg/test-hex.c index a7cc46d..d9e2cf7 100644 --- a/egg/test-hex.c +++ b/egg/test-hex.c @@ -22,6 +22,8 @@ #include "config.h" +#undef G_DISABLE_ASSERT + #include "egg/egg-hex.h" #include diff --git a/egg/test-hkdf.c b/egg/test-hkdf.c index 5114914..289e702 100644 --- a/egg/test-hkdf.c +++ b/egg/test-hkdf.c @@ -22,6 +22,8 @@ #include "config.h" +#undef G_DISABLE_ASSERT + #include #include #include @@ -32,6 +34,8 @@ #include +#undef G_DISABLE_ASSERT + EGG_SECURE_DEFINE_GLIB_GLOBALS (); static void diff --git a/egg/test-secmem.c b/egg/test-secmem.c index 10c28fc..7975eca 100644 --- a/egg/test-secmem.c +++ b/egg/test-secmem.c @@ -22,6 +22,8 @@ #include "config.h" +#undef G_DISABLE_ASSERT + #include "egg/egg-secure-memory.h" #include diff --git a/libsecret/test-attributes.c b/libsecret/test-attributes.c index c1c8215..f202989 100644 --- a/libsecret/test-attributes.c +++ b/libsecret/test-attributes.c @@ -15,6 +15,8 @@ #include "config.h" +#undef G_DISABLE_ASSERT + #include "secret-attributes.h" #include "secret-private.h" diff --git a/libsecret/test-collection.c b/libsecret/test-collection.c index 94c6d41..1ab4441 100644 --- a/libsecret/test-collection.c +++ b/libsecret/test-collection.c @@ -15,6 +15,8 @@ #include "config.h" +#undef G_DISABLE_ASSERT + #include "secret-collection.h" #include "secret-service.h" #include "secret-paths.h" diff --git a/libsecret/test-item.c b/libsecret/test-item.c index 2ef6f0e..258e1e8 100644 --- a/libsecret/test-item.c +++ b/libsecret/test-item.c @@ -15,6 +15,8 @@ #include "config.h" +#undef G_DISABLE_ASSERT + #include "secret-collection.h" #include "secret-item.h" #include "secret-service.h" diff --git a/libsecret/test-methods.c b/libsecret/test-methods.c index c294848..a1cc595 100644 --- a/libsecret/test-methods.c +++ b/libsecret/test-methods.c @@ -13,6 +13,8 @@ #include "config.h" +#undef G_DISABLE_ASSERT + #include "secret-attributes.h" #include "secret-collection.h" #include "secret-item.h" diff --git a/libsecret/test-password.c b/libsecret/test-password.c index ab95859..cbfb561 100644 --- a/libsecret/test-password.c +++ b/libsecret/test-password.c @@ -14,6 +14,8 @@ #include "config.h" +#undef G_DISABLE_ASSERT + #include "secret-password.h" #include "secret-paths.h" #include "secret-private.h" diff --git a/libsecret/test-paths.c b/libsecret/test-paths.c index 8c32055..54a911a 100644 --- a/libsecret/test-paths.c +++ b/libsecret/test-paths.c @@ -13,6 +13,8 @@ #include "config.h" +#undef G_DISABLE_ASSERT + #include "secret-attributes.h" #include "secret-collection.h" #include "secret-item.h" diff --git a/libsecret/test-prompt.c b/libsecret/test-prompt.c index 54368fa..a0c5b77 100644 --- a/libsecret/test-prompt.c +++ b/libsecret/test-prompt.c @@ -15,6 +15,8 @@ #include "config.h" +#undef G_DISABLE_ASSERT + #include "secret-item.h" #include "secret-service.h" #include "secret-private.h" diff --git a/libsecret/test-service.c b/libsecret/test-service.c index 4759830..15a17d6 100644 --- a/libsecret/test-service.c +++ b/libsecret/test-service.c @@ -13,6 +13,8 @@ #include "config.h" +#undef G_DISABLE_ASSERT + #include "secret-collection.h" #include "secret-item.h" #include "secret-service.h" diff --git a/libsecret/test-session.c b/libsecret/test-session.c index f82db74..8e993ee 100644 --- a/libsecret/test-session.c +++ b/libsecret/test-session.c @@ -13,6 +13,8 @@ #include "config.h" +#undef G_DISABLE_ASSERT + #include "secret-item.h" #include "secret-service.h" #include "secret-paths.h" diff --git a/libsecret/test-value.c b/libsecret/test-value.c index c4a538e..a46458d 100644 --- a/libsecret/test-value.c +++ b/libsecret/test-value.c @@ -13,6 +13,8 @@ #include "config.h" +#undef G_DISABLE_ASSERT + #include "secret-value.h" #include "secret-private.h" From 0be63575ff47f19cff3688985c7f00e92bc25541 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Sat, 29 Jun 2019 06:54:40 +0200 Subject: [PATCH 2/2] build: Suppress compiler warning if compiled with G_DISABLE_ASSERT --- libsecret/secret-schemas.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libsecret/secret-schemas.c b/libsecret/secret-schemas.c index 7f93fc7..f07a2ac 100644 --- a/libsecret/secret-schemas.c +++ b/libsecret/secret-schemas.c @@ -110,4 +110,5 @@ secret_get_schema (SecretSchemaType type) default: g_assert_not_reached (); } + g_return_val_if_reached (NULL); }