Re: [Libosinfo] [libosinfo] tests: Remove calls to g_log_set_always_fatal()

2018-03-11 Thread Fabiano FidĂȘncio
On Wed, Feb 14, 2018 at 11:09 AM, Christophe Fergeau
 wrote:
> Ping?

Ack! And will be pushed Today with a few other patches!

>
> Christophe
>
> On Mon, Jan 15, 2018 at 01:08:13PM +0100, Christophe Fergeau wrote:
>> All tests call that method because they want g_warning() to be fatal.
>> Since the switch to GTest, this is no longer necessary as this is the
>> default  behaviour.
>>
>> Signed-off-by: Christophe Fergeau 
>> ---
>>  tests/test-db.c | 3 ---
>>  tests/test-device.c | 3 ---
>>  tests/test-devicelist.c | 3 ---
>>  tests/test-entity.c | 3 ---
>>  tests/test-filter.c | 3 ---
>>  tests/test-install-script.c | 3 ---
>>  tests/test-isodetect.c  | 3 ---
>>  tests/test-list.c   | 3 ---
>>  tests/test-loader.c | 3 ---
>>  tests/test-mediauris.c  | 3 ---
>>  tests/test-os.c | 3 ---
>>  tests/test-oslist.c | 3 ---
>>  tests/test-platform.c   | 3 ---
>>  tests/test-platformlist.c   | 3 ---
>>  tests/test-product.c| 3 ---
>>  tests/test-productfilter.c  | 3 ---
>>  tests/test-treeuris.c   | 3 ---
>>  17 files changed, 51 deletions(-)
>>
>> diff --git a/tests/test-db.c b/tests/test-db.c
>> index ac0a529b..553cea2e 100644
>> --- a/tests/test-db.c
>> +++ b/tests/test-db.c
>> @@ -411,9 +411,6 @@ main(int argc, char *argv[])
>>  g_test_add_func("/db/prop_os", test_prop_os);
>>  g_test_add_func("/db/rel_os", test_rel_os);
>>
>> -/* Make sure we catch unexpected g_warning() */
>> -g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | 
>> G_LOG_LEVEL_WARNING);
>> -
>>  /* Upfront so we don't confuse valgrind */
>>  osinfo_entity_get_type();
>>  osinfo_db_get_type();
>> diff --git a/tests/test-device.c b/tests/test-device.c
>> index f14eebab..064ccc27 100644
>> --- a/tests/test-device.c
>> +++ b/tests/test-device.c
>> @@ -44,9 +44,6 @@ main(int argc, char *argv[])
>>
>>  g_test_add_func("/device/basic", test_basic);
>>
>> -/* Make sure we catch unexpected g_warning() */
>> -g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | 
>> G_LOG_LEVEL_WARNING);
>> -
>>  /* Upfront so we don't confuse valgrind */
>>  osinfo_device_get_type();
>>
>> diff --git a/tests/test-devicelist.c b/tests/test-devicelist.c
>> index cd697934..0c9e3e85 100644
>> --- a/tests/test-devicelist.c
>> +++ b/tests/test-devicelist.c
>> @@ -213,9 +213,6 @@ main(int argc, char *argv[])
>>  g_test_add_func("/devicelist/intersect", test_intersect);
>>  g_test_add_func("/devicelist/filter", test_filter);
>>
>> -/* Make sure we catch unexpected g_warning() */
>> -g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | 
>> G_LOG_LEVEL_WARNING);
>> -
>>  /* Upfront so we don't confuse valgrind */
>>  osinfo_device_get_type();
>>  osinfo_devicelist_get_type();
>> diff --git a/tests/test-entity.c b/tests/test-entity.c
>> index 5f7233b8..b89f0b5a 100644
>> --- a/tests/test-entity.c
>> +++ b/tests/test-entity.c
>> @@ -323,9 +323,6 @@ main(int argc, char *argv[])
>>  g_test_add_func("/entity/multi_props_clear", test_multi_props_clear);
>>  g_test_add_func("/entity/int64_props", test_int64_props);
>>
>> -/* Make sure we catch unexpected g_warning() */
>> -g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | 
>> G_LOG_LEVEL_WARNING);
>> -
>>  /* Upfront so we don't confuse valgrind */
>>  osinfo_dummy_get_type();
>>
>> diff --git a/tests/test-filter.c b/tests/test-filter.c
>> index 3fbeb3e2..9afbc7fb 100644
>> --- a/tests/test-filter.c
>> +++ b/tests/test-filter.c
>> @@ -161,9 +161,6 @@ main(int argc, char *argv[])
>>  g_test_add_func("/filter/filter_multi", test_filter_multi);
>>  g_test_add_func("/filter/filter_combine", test_filter_combine);
>>
>> -/* Make sure we catch unexpected g_warning() */
>> -g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | 
>> G_LOG_LEVEL_WARNING);
>> -
>>  /* Upfront so we don't confuse valgrind */
>>  osinfo_device_get_type();
>>  osinfo_filter_get_type();
>> diff --git a/tests/test-install-script.c b/tests/test-install-script.c
>> index fa692a39..bb9e79a5 100644
>> --- a/tests/test-install-script.c
>> +++ b/tests/test-install-script.c
>> @@ -309,9 +309,6 @@ main(int argc, char *argv[])
>>  g_test_add_func("/install-script/script_data", test_script_data);
>>  g_test_add_func("/install-script/script_datamap", test_script_datamap);
>>
>> -/* Make sure we catch unexpected g_warning() */
>> -g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | 
>> G_LOG_LEVEL_WARNING);
>> -
>>  /* Upfront so we don't confuse valgrind */
>>  osinfo_entity_get_type();
>>  osinfo_db_get_type();
>> diff --git a/tests/test-isodetect.c b/tests/test-isodetect.c
>> index 51137284..1f6e5504 100644
>> --- a/tests/test-isodetect.c
>> +++ b/tests/test-isodetect.c
>> @@ -480,9 +480,6 @@ main(int 

Re: [Libosinfo] [libosinfo] tests: Remove calls to g_log_set_always_fatal()

2018-02-14 Thread Christophe Fergeau
Ping?

Christophe

On Mon, Jan 15, 2018 at 01:08:13PM +0100, Christophe Fergeau wrote:
> All tests call that method because they want g_warning() to be fatal.
> Since the switch to GTest, this is no longer necessary as this is the
> default  behaviour.
> 
> Signed-off-by: Christophe Fergeau 
> ---
>  tests/test-db.c | 3 ---
>  tests/test-device.c | 3 ---
>  tests/test-devicelist.c | 3 ---
>  tests/test-entity.c | 3 ---
>  tests/test-filter.c | 3 ---
>  tests/test-install-script.c | 3 ---
>  tests/test-isodetect.c  | 3 ---
>  tests/test-list.c   | 3 ---
>  tests/test-loader.c | 3 ---
>  tests/test-mediauris.c  | 3 ---
>  tests/test-os.c | 3 ---
>  tests/test-oslist.c | 3 ---
>  tests/test-platform.c   | 3 ---
>  tests/test-platformlist.c   | 3 ---
>  tests/test-product.c| 3 ---
>  tests/test-productfilter.c  | 3 ---
>  tests/test-treeuris.c   | 3 ---
>  17 files changed, 51 deletions(-)
> 
> diff --git a/tests/test-db.c b/tests/test-db.c
> index ac0a529b..553cea2e 100644
> --- a/tests/test-db.c
> +++ b/tests/test-db.c
> @@ -411,9 +411,6 @@ main(int argc, char *argv[])
>  g_test_add_func("/db/prop_os", test_prop_os);
>  g_test_add_func("/db/rel_os", test_rel_os);
>  
> -/* Make sure we catch unexpected g_warning() */
> -g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | 
> G_LOG_LEVEL_WARNING);
> -
>  /* Upfront so we don't confuse valgrind */
>  osinfo_entity_get_type();
>  osinfo_db_get_type();
> diff --git a/tests/test-device.c b/tests/test-device.c
> index f14eebab..064ccc27 100644
> --- a/tests/test-device.c
> +++ b/tests/test-device.c
> @@ -44,9 +44,6 @@ main(int argc, char *argv[])
>  
>  g_test_add_func("/device/basic", test_basic);
>  
> -/* Make sure we catch unexpected g_warning() */
> -g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | 
> G_LOG_LEVEL_WARNING);
> -
>  /* Upfront so we don't confuse valgrind */
>  osinfo_device_get_type();
>  
> diff --git a/tests/test-devicelist.c b/tests/test-devicelist.c
> index cd697934..0c9e3e85 100644
> --- a/tests/test-devicelist.c
> +++ b/tests/test-devicelist.c
> @@ -213,9 +213,6 @@ main(int argc, char *argv[])
>  g_test_add_func("/devicelist/intersect", test_intersect);
>  g_test_add_func("/devicelist/filter", test_filter);
>  
> -/* Make sure we catch unexpected g_warning() */
> -g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | 
> G_LOG_LEVEL_WARNING);
> -
>  /* Upfront so we don't confuse valgrind */
>  osinfo_device_get_type();
>  osinfo_devicelist_get_type();
> diff --git a/tests/test-entity.c b/tests/test-entity.c
> index 5f7233b8..b89f0b5a 100644
> --- a/tests/test-entity.c
> +++ b/tests/test-entity.c
> @@ -323,9 +323,6 @@ main(int argc, char *argv[])
>  g_test_add_func("/entity/multi_props_clear", test_multi_props_clear);
>  g_test_add_func("/entity/int64_props", test_int64_props);
>  
> -/* Make sure we catch unexpected g_warning() */
> -g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | 
> G_LOG_LEVEL_WARNING);
> -
>  /* Upfront so we don't confuse valgrind */
>  osinfo_dummy_get_type();
>  
> diff --git a/tests/test-filter.c b/tests/test-filter.c
> index 3fbeb3e2..9afbc7fb 100644
> --- a/tests/test-filter.c
> +++ b/tests/test-filter.c
> @@ -161,9 +161,6 @@ main(int argc, char *argv[])
>  g_test_add_func("/filter/filter_multi", test_filter_multi);
>  g_test_add_func("/filter/filter_combine", test_filter_combine);
>  
> -/* Make sure we catch unexpected g_warning() */
> -g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | 
> G_LOG_LEVEL_WARNING);
> -
>  /* Upfront so we don't confuse valgrind */
>  osinfo_device_get_type();
>  osinfo_filter_get_type();
> diff --git a/tests/test-install-script.c b/tests/test-install-script.c
> index fa692a39..bb9e79a5 100644
> --- a/tests/test-install-script.c
> +++ b/tests/test-install-script.c
> @@ -309,9 +309,6 @@ main(int argc, char *argv[])
>  g_test_add_func("/install-script/script_data", test_script_data);
>  g_test_add_func("/install-script/script_datamap", test_script_datamap);
>  
> -/* Make sure we catch unexpected g_warning() */
> -g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | 
> G_LOG_LEVEL_WARNING);
> -
>  /* Upfront so we don't confuse valgrind */
>  osinfo_entity_get_type();
>  osinfo_db_get_type();
> diff --git a/tests/test-isodetect.c b/tests/test-isodetect.c
> index 51137284..1f6e5504 100644
> --- a/tests/test-isodetect.c
> +++ b/tests/test-isodetect.c
> @@ -480,9 +480,6 @@ main(int argc, char *argv[])
>  g_test_add_func("/isodetect/sles", test_sles);
>  g_test_add_func("/isodetect/sled", test_sled);
>  
> -/* Make sure we catch unexpected g_warning() */
> -g_log_set_always_fatal(G_LOG_LEVEL_ERROR |