|
Packit Service |
2781ba |
/*
|
|
Packit Service |
2781ba |
* This program is free software; you can redistribute it and/or modify
|
|
Packit Service |
2781ba |
* it under the terms of the GNU General Public License as published by
|
|
Packit Service |
2781ba |
* the Free Software Foundation; either version 3 of the License, or
|
|
Packit Service |
2781ba |
* (at your option) any later version.
|
|
Packit Service |
2781ba |
*
|
|
Packit Service |
2781ba |
* This program is distributed in the hope that it will be useful,
|
|
Packit Service |
2781ba |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
2781ba |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
2781ba |
* GNU General Public License for more details.
|
|
Packit Service |
2781ba |
*
|
|
Packit Service |
2781ba |
* You should have received a copy of the GNU General Public License
|
|
Packit Service |
2781ba |
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
Packit Service |
2781ba |
*
|
|
Packit Service |
2781ba |
* Copyright (C) 2010 Martin Nordholts
|
|
Packit Service |
2781ba |
*/
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
#include "config.h"
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
#include "gegl.h"
|
|
Packit Service |
2781ba |
#include "gegl-plugin.h"
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
#define SUCCESS 0
|
|
Packit Service |
2781ba |
#define FAILURE -1
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
static int
|
|
Packit Service |
2781ba |
test_misc_case_insensitive_extension_handler (void)
|
|
Packit Service |
2781ba |
{
|
|
Packit Service |
2781ba |
gint result = SUCCESS;
|
|
Packit Service |
2781ba |
const gchar *handler = "gegl:foo-handler";
|
|
Packit Service |
2781ba |
const gchar *lowercase = "fooext";
|
|
Packit Service |
2781ba |
const gchar *uppercase = "FOOEXT";
|
|
Packit Service |
2781ba |
const gchar *received_handler = NULL;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
gegl_extension_handler_register (lowercase, handler);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
/* Make sure comparisions are case insensitive */
|
|
Packit Service |
2781ba |
received_handler = gegl_extension_handler_get (uppercase);
|
|
Packit Service |
2781ba |
if (! strcmp (received_handler, handler) == 0)
|
|
Packit Service |
2781ba |
result = FAILURE;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
return result;
|
|
Packit Service |
2781ba |
}
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
static int
|
|
Packit Service |
2781ba |
test_misc_save_handler (void)
|
|
Packit Service |
2781ba |
{
|
|
Packit Service |
2781ba |
gint result = SUCCESS;
|
|
Packit Service |
2781ba |
const gchar *handler = "gegl:bar-handler";
|
|
Packit Service |
2781ba |
const gchar *ext = "barext";
|
|
Packit Service |
2781ba |
const gchar *received_handler = NULL;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
gegl_extension_handler_register_saver (ext, handler);
|
|
Packit Service |
2781ba |
received_handler = gegl_extension_handler_get_saver (ext);
|
|
Packit Service |
2781ba |
if (! strcmp (received_handler, handler) == 0)
|
|
Packit Service |
2781ba |
result = FAILURE;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
return result;
|
|
Packit Service |
2781ba |
}
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
int main(int argc, char *argv[])
|
|
Packit Service |
2781ba |
{
|
|
Packit Service |
2781ba |
gint result = SUCCESS;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
if (result == SUCCESS)
|
|
Packit Service |
2781ba |
result = test_misc_case_insensitive_extension_handler ();
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
if (result == SUCCESS)
|
|
Packit Service |
2781ba |
result = test_misc_save_handler ();
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
return result;
|
|
Packit Service |
2781ba |
}
|