[fpc-pascal] XML-XSD export: importer & how to test

Ludo Brands ludo.brands at free.fr
Thu Jul 28 20:27:00 CEST 2011


> Agreed, but you cannot every kind of data type, for that you 
> will probably need the various databases... and hopefully a 
> continuous integration server to run the tests...
> 

Sqldb converts databases types to the internal ftxxx datatypes. So, yes, you
can everything without external databases. 

> But yes, you're then testing the fcl-db drivers/framework as 
> much as the export functionality. Not a completely bad thing.
> 

Testing multiple layers at the same time is always dificult since
interpreting errors is complex. Unit testing was invented for that purpose. 

> Whenever you have time, could you send me a dump of the table 
> definition with or without data? That would save me doing that...
> 

No problem. Here it comes:

CREATE TABLE `testodbc` (
  `id` int(11) NOT NULL auto_increment,
  `s_int` int(11) default NULL,
  `u_int` int(10) unsigned default NULL,
  `s_tinyint` tinyint(4) default NULL,
  `u_tinyint` tinyint(3) unsigned default NULL,
  `s_smallint` smallint(6) default NULL,
  `u_smallint` smallint(5) unsigned default NULL,
  `s_mediumint` mediumint(9) default NULL,
  `u_mediumint` mediumint(8) unsigned default NULL,
  `s_bigint` bigint(20) default NULL,
  `u_bigint` bigint(20) unsigned default NULL,
  `t_float` float default NULL,
  `t_double` double default NULL,
  `t_decimal` decimal(10,4) default NULL,
  `t_datetime` datetime default NULL,
  `t_date` date default NULL,
  `t_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `t_time` time default NULL,
  `t_year` year(4) default NULL,
  `l_char1` char(1) character set latin1 collate latin1_general_cs default
NULL,
  `u_char1` char(1) character set utf8 collate utf8_bin default NULL,
  `l_char20` char(20) character set latin1 collate latin1_general_cs default
NULL,
  `u_char20` char(20) character set utf8 collate utf8_bin default NULL,
  `l_varchar10` varchar(10) character set latin1 collate latin1_general_cs
default NULL,
  `u_varchar10` varchar(10) character set utf8 collate utf8_bin default
NULL,
  `l_varchar300` varchar(300) character set latin1 collate latin1_general_cs
default NULL,
  `u_varchar300` varchar(300) character set utf8 collate utf8_bin default
NULL,
  `l_tinytext` tinytext character set latin1 collate latin1_general_cs,
  `u_tinytext` tinytext character set utf8 collate utf8_bin,
  `u_mediumtext` mediumtext character set utf8 collate utf8_bin,
  `u_text` text character set utf8 collate utf8_bin,
  `u_longtext` longtext character set utf8 collate utf8_bin,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1
COLLATE=latin1_german2_ci

Note the u_char1 which is too small to hold a multiple byte utf character!


Ludo

> Reinier
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org 
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> 




More information about the fpc-pascal mailing list