app/tests: Remove static Gimp *gimp
Say no to evilness.
This commit is contained in:
@ -63,9 +63,6 @@ static void gimp_test_image_teardown (GimpTestFixture *fixture,
|
|||||||
gconstpointer data);
|
gconstpointer data);
|
||||||
|
|
||||||
|
|
||||||
static Gimp *gimp = NULL;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_test_image_setup:
|
* gimp_test_image_setup:
|
||||||
* @fixture:
|
* @fixture:
|
||||||
@ -77,6 +74,8 @@ static void
|
|||||||
gimp_test_image_setup (GimpTestFixture *fixture,
|
gimp_test_image_setup (GimpTestFixture *fixture,
|
||||||
gconstpointer data)
|
gconstpointer data)
|
||||||
{
|
{
|
||||||
|
Gimp *gimp = GIMP (data);
|
||||||
|
|
||||||
fixture->image = gimp_image_new (gimp,
|
fixture->image = gimp_image_new (gimp,
|
||||||
GIMP_TEST_IMAGE_SIZE,
|
GIMP_TEST_IMAGE_SIZE,
|
||||||
GIMP_TEST_IMAGE_SIZE,
|
GIMP_TEST_IMAGE_SIZE,
|
||||||
@ -110,6 +109,7 @@ static void
|
|||||||
rotate_non_overlapping (GimpTestFixture *fixture,
|
rotate_non_overlapping (GimpTestFixture *fixture,
|
||||||
gconstpointer data)
|
gconstpointer data)
|
||||||
{
|
{
|
||||||
|
Gimp *gimp = GIMP (data);
|
||||||
GimpImage *image = fixture->image;
|
GimpImage *image = fixture->image;
|
||||||
GimpLayer *layer;
|
GimpLayer *layer;
|
||||||
GimpContext *context = gimp_context_new (gimp, "Test", NULL /*template*/);
|
GimpContext *context = gimp_context_new (gimp, "Test", NULL /*template*/);
|
||||||
@ -225,6 +225,7 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char **argv)
|
char **argv)
|
||||||
{
|
{
|
||||||
|
Gimp *gimp;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
g_thread_init (NULL);
|
g_thread_init (NULL);
|
||||||
|
@ -138,7 +138,7 @@
|
|||||||
#define ADD_TEST(function) \
|
#define ADD_TEST(function) \
|
||||||
g_test_add ("/gimp-xcf/" #function, \
|
g_test_add ("/gimp-xcf/" #function, \
|
||||||
GimpTestFixture, \
|
GimpTestFixture, \
|
||||||
NULL, \
|
gimp, \
|
||||||
NULL, \
|
NULL, \
|
||||||
function, \
|
function, \
|
||||||
NULL);
|
NULL);
|
||||||
@ -152,10 +152,12 @@ typedef struct
|
|||||||
|
|
||||||
GimpImage * gimp_test_load_image (Gimp *gimp,
|
GimpImage * gimp_test_load_image (Gimp *gimp,
|
||||||
const gchar *uri);
|
const gchar *uri);
|
||||||
static void gimp_write_and_read_file (gboolean with_unusual_stuff,
|
static void gimp_write_and_read_file (Gimp *gimp,
|
||||||
|
gboolean with_unusual_stuff,
|
||||||
gboolean compat_paths,
|
gboolean compat_paths,
|
||||||
gboolean use_gimp_2_8_features);
|
gboolean use_gimp_2_8_features);
|
||||||
static GimpImage * gimp_create_mainimage (gboolean with_unusual_stuff,
|
static GimpImage * gimp_create_mainimage (Gimp *gimp,
|
||||||
|
gboolean with_unusual_stuff,
|
||||||
gboolean compat_paths,
|
gboolean compat_paths,
|
||||||
gboolean use_gimp_2_8_features);
|
gboolean use_gimp_2_8_features);
|
||||||
static void gimp_assert_mainimage (GimpImage *image,
|
static void gimp_assert_mainimage (GimpImage *image,
|
||||||
@ -164,9 +166,6 @@ static void gimp_assert_mainimage (GimpImage
|
|||||||
gboolean use_gimp_2_8_features);
|
gboolean use_gimp_2_8_features);
|
||||||
|
|
||||||
|
|
||||||
static Gimp *gimp = NULL;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* write_and_read_gimp_2_6_format:
|
* write_and_read_gimp_2_6_format:
|
||||||
* @fixture:
|
* @fixture:
|
||||||
@ -179,7 +178,10 @@ static void
|
|||||||
write_and_read_gimp_2_6_format (GimpTestFixture *fixture,
|
write_and_read_gimp_2_6_format (GimpTestFixture *fixture,
|
||||||
gconstpointer data)
|
gconstpointer data)
|
||||||
{
|
{
|
||||||
gimp_write_and_read_file (FALSE /*with_unusual_stuff*/,
|
Gimp *gimp = GIMP (data);
|
||||||
|
|
||||||
|
gimp_write_and_read_file (gimp,
|
||||||
|
FALSE /*with_unusual_stuff*/,
|
||||||
FALSE /*compat_paths*/,
|
FALSE /*compat_paths*/,
|
||||||
FALSE /*use_gimp_2_8_features*/);
|
FALSE /*use_gimp_2_8_features*/);
|
||||||
}
|
}
|
||||||
@ -197,7 +199,10 @@ static void
|
|||||||
write_and_read_gimp_2_6_format_unusual (GimpTestFixture *fixture,
|
write_and_read_gimp_2_6_format_unusual (GimpTestFixture *fixture,
|
||||||
gconstpointer data)
|
gconstpointer data)
|
||||||
{
|
{
|
||||||
gimp_write_and_read_file (TRUE /*with_unusual_stuff*/,
|
Gimp *gimp = GIMP (data);
|
||||||
|
|
||||||
|
gimp_write_and_read_file (gimp,
|
||||||
|
TRUE /*with_unusual_stuff*/,
|
||||||
TRUE /*compat_paths*/,
|
TRUE /*compat_paths*/,
|
||||||
FALSE /*use_gimp_2_8_features*/);
|
FALSE /*use_gimp_2_8_features*/);
|
||||||
}
|
}
|
||||||
@ -214,6 +219,7 @@ static void
|
|||||||
load_gimp_2_6_file (GimpTestFixture *fixture,
|
load_gimp_2_6_file (GimpTestFixture *fixture,
|
||||||
gconstpointer data)
|
gconstpointer data)
|
||||||
{
|
{
|
||||||
|
Gimp *gimp = GIMP (data);
|
||||||
GimpImage *image = NULL;
|
GimpImage *image = NULL;
|
||||||
gchar *uri = NULL;
|
gchar *uri = NULL;
|
||||||
|
|
||||||
@ -248,7 +254,10 @@ static void
|
|||||||
write_and_read_gimp_2_8_format (GimpTestFixture *fixture,
|
write_and_read_gimp_2_8_format (GimpTestFixture *fixture,
|
||||||
gconstpointer data)
|
gconstpointer data)
|
||||||
{
|
{
|
||||||
gimp_write_and_read_file (FALSE /*with_unusual_stuff*/,
|
Gimp *gimp = GIMP (data);
|
||||||
|
|
||||||
|
gimp_write_and_read_file (gimp,
|
||||||
|
FALSE /*with_unusual_stuff*/,
|
||||||
FALSE /*compat_paths*/,
|
FALSE /*compat_paths*/,
|
||||||
TRUE /*use_gimp_2_8_features*/);
|
TRUE /*use_gimp_2_8_features*/);
|
||||||
}
|
}
|
||||||
@ -288,7 +297,8 @@ gimp_test_load_image (Gimp *gimp,
|
|||||||
* function can be used for different formats.
|
* function can be used for different formats.
|
||||||
**/
|
**/
|
||||||
static void
|
static void
|
||||||
gimp_write_and_read_file (gboolean with_unusual_stuff,
|
gimp_write_and_read_file (Gimp *gimp,
|
||||||
|
gboolean with_unusual_stuff,
|
||||||
gboolean compat_paths,
|
gboolean compat_paths,
|
||||||
gboolean use_gimp_2_8_features)
|
gboolean use_gimp_2_8_features)
|
||||||
{
|
{
|
||||||
@ -298,7 +308,8 @@ gimp_write_and_read_file (gboolean with_unusual_stuff,
|
|||||||
gchar *uri = NULL;
|
gchar *uri = NULL;
|
||||||
|
|
||||||
/* Create the image */
|
/* Create the image */
|
||||||
image = gimp_create_mainimage (with_unusual_stuff,
|
image = gimp_create_mainimage (gimp,
|
||||||
|
with_unusual_stuff,
|
||||||
compat_paths,
|
compat_paths,
|
||||||
use_gimp_2_8_features);
|
use_gimp_2_8_features);
|
||||||
|
|
||||||
@ -348,7 +359,8 @@ gimp_write_and_read_file (gboolean with_unusual_stuff,
|
|||||||
* Returns: The #GimpImage
|
* Returns: The #GimpImage
|
||||||
**/
|
**/
|
||||||
static GimpImage *
|
static GimpImage *
|
||||||
gimp_create_mainimage (gboolean with_unusual_stuff,
|
gimp_create_mainimage (Gimp *gimp,
|
||||||
|
gboolean with_unusual_stuff,
|
||||||
gboolean compat_paths,
|
gboolean compat_paths,
|
||||||
gboolean use_gimp_2_8_features)
|
gboolean use_gimp_2_8_features)
|
||||||
{
|
{
|
||||||
@ -972,6 +984,7 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char **argv)
|
char **argv)
|
||||||
{
|
{
|
||||||
|
Gimp *gimp;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
g_thread_init (NULL);
|
g_thread_init (NULL);
|
||||||
|
Reference in New Issue
Block a user