mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-23 08:32:42 +00:00
bf2901b473
git-svn-id: http://svn.osgeo.org/postgis/trunk@12198 b70326c6-7e19-0410-871a-916f4a2858ee
79 lines
1.8 KiB
C
79 lines
1.8 KiB
C
/**********************************************************************
|
|
* $Id: cu_pgsql2shp.c 5674 2010-06-03 02:04:15Z mleslie $
|
|
*
|
|
* PostGIS - Spatial Types for PostgreSQL
|
|
* http://postgis.net
|
|
* Copyright 2010 LISAsoft Pty Ltd
|
|
*
|
|
* This is free software; you can redistribute and/or modify it under
|
|
* the terms of the GNU General Public Licence. See the COPYING file.
|
|
*
|
|
**********************************************************************/
|
|
|
|
#include "cu_pgsql2shp.h"
|
|
#include "cu_tester.h"
|
|
#include "../pgsql2shp-core.h"
|
|
|
|
/* Test functions */
|
|
void test_ShpDumperCreate(void);
|
|
void test_ShpDumperDestroy(void);
|
|
|
|
SHPDUMPERCONFIG *dumper_config;
|
|
SHPDUMPERSTATE *dumper_state;
|
|
|
|
/*
|
|
** Called from test harness to register the tests in this file.
|
|
*/
|
|
CU_pSuite register_pgsql2shp_suite(void)
|
|
{
|
|
CU_pSuite pSuite;
|
|
pSuite = CU_add_suite("Shapefile Loader File pgsql2shp Test", init_pgsql2shp_suite, clean_pgsql2shp_suite);
|
|
if (NULL == pSuite)
|
|
{
|
|
CU_cleanup_registry();
|
|
return NULL;
|
|
}
|
|
|
|
if (
|
|
(NULL == CU_add_test(pSuite, "test_ShpDumperCreate()", test_ShpDumperCreate)) ||
|
|
(NULL == CU_add_test(pSuite, "test_ShpDumperDestroy()", test_ShpDumperDestroy))
|
|
)
|
|
{
|
|
CU_cleanup_registry();
|
|
return NULL;
|
|
}
|
|
return pSuite;
|
|
}
|
|
|
|
/*
|
|
** The suite initialization function.
|
|
** Create any re-used objects.
|
|
*/
|
|
int init_pgsql2shp_suite(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
/*
|
|
** The suite cleanup function.
|
|
** Frees any global objects.
|
|
*/
|
|
int clean_pgsql2shp_suite(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
void test_ShpDumperCreate(void)
|
|
{
|
|
dumper_config = (SHPDUMPERCONFIG*)calloc(1, sizeof(SHPDUMPERCONFIG));
|
|
set_dumper_config_defaults(dumper_config);
|
|
dumper_state = ShpDumperCreate(dumper_config);
|
|
CU_ASSERT_PTR_NOT_NULL(dumper_state);
|
|
CU_ASSERT_EQUAL(dumper_state->config->fetchsize, 100);
|
|
}
|
|
|
|
void test_ShpDumperDestroy(void)
|
|
{
|
|
ShpDumperDestroy(dumper_state);
|
|
}
|