From: Marvin Schmidt Date: Tue, 26 Nov 2013 07:50:52 +0000 (+0100) Subject: Fix test failure X-Git-Tag: libsigrok-0.3.0~468 X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;h=c3e2b08dc9a252ada9b9a51ae47ea588135944e1;p=libsigrok.git Fix test failure The GError object has to initialized to NULL before being passed to g_file_set_contents or it will throw the following critical warning GLib-CRITICAL **: g_file_set_contents: assertion 'error == NULL || *error == NULL' failed and return FALSE, which leads to failed assertion and subsequently to the test failing --- diff --git a/tests/lib.c b/tests/lib.c index 58edbf9e..39c036f6 100644 --- a/tests/lib.c +++ b/tests/lib.c @@ -198,7 +198,7 @@ void srtest_check_samplerate(struct sr_context *sr_ctx, const char *drivername, void srtest_buf_to_file(const char *filename, const uint8_t *buf, uint64_t len) { FILE *f; - GError *error; + GError *error = NULL; gboolean ret; f = g_fopen(filename, "wb");