tests: Move some specific GLib compatibility to compatibility file

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Frediano Ziglio 2017-03-02 13:45:14 +00:00
parent b7a7ed3900
commit 73f8a65d06
5 changed files with 12 additions and 26 deletions

View File

@ -16,13 +16,9 @@
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <glib.h>
#include <spice.h>
/* GLIB_CHECK_VERSION(2, 40, 0) */
#ifndef g_assert_nonnull
#define g_assert_nonnull g_assert
#endif
#include "test-glib-compat.h"
static void codecs_good(void)
{

View File

@ -31,4 +31,12 @@ void g_test_expect_message(const gchar *log_domain, GLogLevelFlags log_level,
const gchar *pattern);
#endif
/* GLIB_CHECK_VERSION(2, 40, 0) */
#ifndef g_assert_nonnull
#define g_assert_nonnull g_assert
#endif
#ifndef g_assert_null
#define g_assert_null(ptr) g_assert((ptr) == NULL)
#endif
#endif // TEST_GLIB_COMPAT_H_

View File

@ -16,16 +16,11 @@
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <glib.h>
#include <spice.h>
#include "test-glib-compat.h"
#include "basic-event-loop.h"
/* GLIB_CHECK_VERSION(2, 40, 0) */
#ifndef g_assert_nonnull
#define g_assert_nonnull g_assert
#endif
static void leaks(void)
{
int result;

View File

@ -16,16 +16,11 @@
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <glib.h>
#include <spice.h>
#include "test-glib-compat.h"
#include "basic-event-loop.h"
/* GLIB_CHECK_VERSION(2, 40, 0) */
#ifndef g_assert_nonnull
#define g_assert_nonnull g_assert
#endif
static void agent_options(void)
{
SpiceCoreInterface *core ;

View File

@ -19,19 +19,11 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <glib.h>
#include <spice.h>
#include "test-glib-compat.h"
#include "stat-file.h"
/* GLIB_CHECK_VERSION(2, 40, 0) */
#ifndef g_assert_nonnull
#define g_assert_nonnull g_assert
#endif
#ifndef g_assert_null
#define g_assert_null(ptr) g_assert((ptr) == NULL)
#endif
static void stat_file(void)
{
RedStatFile *stat_file;