Re: [fpc-pascal] libusb header translation and OOP wrapper

2012-09-28 Thread Christo
On Tue, 2012-09-25 at 22:16 +0100, Henry Vermaak wrote:
> On 25 September 2012 20:57, Christo  wrote:
> > Any ideas on how to define the calling convention in the import unit so
> > that it is either stdcall or cdecl depending on the target OS?
> 
> I've used a macro for this in the past.  E.g. :
> 
> {$macro on}
> {$ifdef windows}
>   {$define CCONV:=stdcall}
> {$else}
>   {$define CCONV:=cdecl}
> {$endif}

Thanks Henry, that macro worked.  I however have a problem statically
linking to the libusbx library on Windows. I've downloaded the Windows
libusbx 1.0.14 library from sourceforge and pointed the compiler to the
mingw32 folder containing libusb-1.0.a.  

It complains about undefined symbols such as: 
project1.lpr(18,1) Error: Undefined symbol: LIBUSB_LIBUSB_INIT
$PLIBUSB_CONTEXT$$LONGINT

I have changed the calling convention to cdecl and then it also
complains:  project1.lpr(18,1) Error: Undefined symbol: _libusb_init

I've managed to load the library dynamically using LoadLibrary and then
loading each function/procedure using GetProcedureAddress.  This works
both on windows and on Linux.

Anyone knows why the static linking fails on Windows XP sp2?  I'm using
fpc 2.6.0 and have also tried the MS32 .lib library with no success.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] DOM, XMLRead, XMLWrite - cwstring requirement

2012-09-28 Thread Sven Barth

Am 28.09.2012 11:42, schrieb Graeme Geldenhuys:

On 2012-09-28 10:28, michael.vancann...@wisa.be wrote:


No, it is just for the XML reader, since it uses widestrings:


Ah, so it only takes affect on the WideString type, not the String type.
I guess from the name 'widestring manager' I should have seen that
relationship. :)


The most important tasks for the widestring manager is the conversion of 
WideString (and also UnicodeString) to AnsiString with a certain code 
page and the other way round.


Regards,
Sven

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] DOM, XMLRead, XMLWrite - cwstring requirement

2012-09-28 Thread Ludo Brands
> > No, it is just for the XML reader, since it uses widestrings:
> 
> Ah, so it only takes affect on the WideString type, not the 
> String type. I guess from the name 'widestring manager' I 
> should have seen that relationship. :)
> 

Using cwstring does affect some ansistring functions. It comes with its own
version of AnsiCompareText, AnsiStrUpper, etc. which uses the users
LC_COLLATE setting. 

Ludo 

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] DOM, XMLRead, XMLWrite - cwstring requirement

2012-09-28 Thread Graeme Geldenhuys
On 2012-09-28 10:28, michael.vancann...@wisa.be wrote:
> 
> No, it is just for the XML reader, since it uses widestrings:

Ah, so it only takes affect on the WideString type, not the String type.
I guess from the name 'widestring manager' I should have seen that
relationship. :)

Thanks Michael.


> Well, the matter is not entirely clear.

Are such things ever!


> That is why we decided to ask the unicode group what their opinion is
> on this matter.

That's the best option.



Graeme.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Getting fpcunit test results into a database

2012-09-28 Thread Graeme Geldenhuys
On 2012-09-28 10:25, Reinier Olislagers wrote:
> 
> Ah, Listeners thanks. Is this listener concept something that's
> common to more xunit frameworks (junit... etc) or is it an fpcunit
> invention?

I think the idea came from DUnit, though FPCUnit was heavily based on
the JUnit design. DUnit2 and FPTest also use the listeners concept. In
fact the latter two uses interfaces a lot more than FPCUnit, making some
extensions much easier to implement.

I believe other xunit frameworks have similar ideas. Each test framework
seems to use the best [most suitable] features of the language in question.

eg: Object Pascal based test frameworks use published properties, C# and
Java uses class attributes etc to define test methods.

Regards,
  - Graeme -



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: SDFDataset users!?

2012-09-28 Thread Reinier Olislagers
On 25-9-2012 13:59, Reinier Olislagers wrote:
> On 25-9-2012 11:05, michael.vancanneyt-0is9kj9s...@public.gmane.org
>> Well, in the not-too-far future, I'll spend time on improving the DB
>> testsuite.
>>
> 
> In that not-too-far future, you might want to have a look at the
> following patches ;)
> 22970 [Patch] Database test suite: expanded readme
> 22972 Firebird EXECUTE BLOCK RETURNS test
> 22976 [Patch] Database test suite: temporary table test: add support for
> Firebird

and

22377 [Patch] Opening a non-empty dataset doesn't return BOF=true  (at
least the test case part)
23008 [Patch] fcl-db DBtestframework Firebird embedded support

As far as sdfdataset is concerned,
this one by John Kozikopoulos
22980 [FPC] Database Components
is currently assigned to Joost van der Sluis; you might want to have a
look at it.

Thanks,
Reinier
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Getting fpcunit test results into a database

2012-09-28 Thread michael . vancanneyt



On Fri, 28 Sep 2012, Reinier Olislagers wrote:


On 28-9-2012 10:43, Graeme Geldenhuys wrote:

On 2012-09-28 09:18, Reinier Olislagers wrote:


Is there existing code available for getting fpcunit test results into a
database?


No, but the Test Listener interface makes such an addition very easy.

Simply create a TDatabaseListener that implements the ITestListener
interface. It's only 5 required methods to implement. Then simply
register that test listener with the testing framework (via
TestResult.AddListener() call), and it will be fed test results as they
happen.

Each of those 5 ITestListerner methods will then insert records into the
database as needed.


Ah, Listeners thanks. Is this listener concept something that's
common to more xunit frameworks (junit... etc) or is it an fpcunit
invention?


It is common to NNNunit testing frameworks.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] DOM, XMLRead, XMLWrite - cwstring requirement

2012-09-28 Thread michael . vancanneyt



On Fri, 28 Sep 2012, Graeme Geldenhuys wrote:


On 2012-09-28 10:01, michael.vancann...@wisa.be wrote:


I'm also not sure how using cwstring unit would affect fpGUI apps that
use UTF-8 inside AnsiString containers. (just like LCL does)


It all depends on the XML.



Sorry, I'm not very versed on WideString managers, so excuse if this is
a dumb question. Would this (usage of cwstrings) be limited to the XML
usage only (reading/writing from file), or to any place in fpGUI or my
applications that use String as a data type?  TfpgString is defined
explicitly as AnsiString so that should be ok, but there are still lots
of places (and my own projects) that use String instead.

I guess this would cause issues with API calls to external libraries too?


No, it is just for the XML reader, since it uses widestrings: 
it needs to convert the XML to something sensible. 
Hence it needs the widestring manager.


It can be that xmliconv  may be sufficient, Sergei Gorelkin needs to comment
on this.





I know. Some of us think that Embarcadero may be violating the copyright :)


After following the posts in the Embarcadero newsgroup, I felt the same
way. They are using the data from Unicode.org - repackaging it is
irrelevant as far as I'm concerned.


Well, the matter is not entirely clear.

That is why we decided to ask the unicode group what their opinion is on this 
matter.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Getting fpcunit test results into a database

2012-09-28 Thread Reinier Olislagers
On 28-9-2012 10:43, Graeme Geldenhuys wrote:
> On 2012-09-28 09:18, Reinier Olislagers wrote:
>>
>> Is there existing code available for getting fpcunit test results into a
>> database?
> 
> No, but the Test Listener interface makes such an addition very easy.
> 
> Simply create a TDatabaseListener that implements the ITestListener
> interface. It's only 5 required methods to implement. Then simply
> register that test listener with the testing framework (via
> TestResult.AddListener() call), and it will be fed test results as they
> happen.
> 
> Each of those 5 ITestListerner methods will then insert records into the
> database as needed.

Ah, Listeners thanks. Is this listener concept something that's
common to more xunit frameworks (junit... etc) or is it an fpcunit
invention?

Going to dive into the fpcunit code then. Glad I asked ;)

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] DOM, XMLRead, XMLWrite - cwstring requirement

2012-09-28 Thread Graeme Geldenhuys
On 2012-09-28 10:01, michael.vancann...@wisa.be wrote:
>>
>> I'm also not sure how using cwstring unit would affect fpGUI apps that
>> use UTF-8 inside AnsiString containers. (just like LCL does)
> 
> It all depends on the XML.


Sorry, I'm not very versed on WideString managers, so excuse if this is
a dumb question. Would this (usage of cwstrings) be limited to the XML
usage only (reading/writing from file), or to any place in fpGUI or my
applications that use String as a data type?  TfpgString is defined
explicitly as AnsiString so that should be ok, but there are still lots
of places (and my own projects) that use String instead.

I guess this would cause issues with API calls to external libraries too?


> I know. Some of us think that Embarcadero may be violating the copyright :)

After following the posts in the Embarcadero newsgroup, I felt the same
way. They are using the data from Unicode.org - repackaging it is
irrelevant as far as I'm concerned.

Regards,
  - Graeme -

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] DOM, XMLRead, XMLWrite - cwstring requirement

2012-09-28 Thread michael . vancanneyt



On Fri, 28 Sep 2012, Graeme Geldenhuys wrote:


On 2012-09-28 09:41, michael.vancann...@wisa.be wrote:


XMLRead uses it, yes.


Umm, so how would that affect applications that normally use UTF-8
packed in AnsiString? Like fpGUI and LCL based applications.


It depends on the encoding of the XML, I suppose ?



To give you the exact example.
He has XML units he would like to unit test. He can use the FPTest Text
Runner no problem, but he would prefer to use the FPTest GUI Test Runner
(created with fpGUI). Under 64-bit ArchLinux the GUI Test Runner bombs
out at runtime. Under 64-bit Ubuntu or OpenSUSE the GUI Test Runner runs
without problems.

I'm totally baffled as to what would be the cause of the crash at
runtime - just on ArchLinux.


Me too :-)



I'm also not sure how using cwstring unit would affect fpGUI apps that
use UTF-8 inside AnsiString containers. (just like LCL does)


It all depends on the XML.


but we're currently stuck on dealing with a
copyright requirement of the Unicode group.


I saw a similar post (from a FPC developer) in the Delphi newsgroups.


I know. 
Some of us think that Embarcadero may be violating the copyright :)


We have asked clarification of the unicode group, but got no reply yet.
(whether we ever will is another matter)

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] DOM, XMLRead, XMLWrite - cwstring requirement

2012-09-28 Thread Graeme Geldenhuys
On 2012-09-28 09:41, michael.vancann...@wisa.be wrote:
> 
> XMLRead uses it, yes.

Umm, so how would that affect applications that normally use UTF-8
packed in AnsiString? Like fpGUI and LCL based applications.

To give you the exact example.
He has XML units he would like to unit test. He can use the FPTest Text
Runner no problem, but he would prefer to use the FPTest GUI Test Runner
(created with fpGUI). Under 64-bit ArchLinux the GUI Test Runner bombs
out at runtime. Under 64-bit Ubuntu or OpenSUSE the GUI Test Runner runs
without problems.

I'm totally baffled as to what would be the cause of the crash at
runtime - just on ArchLinux.

I'm also not sure how using cwstring unit would affect fpGUI apps that
use UTF-8 inside AnsiString containers. (just like LCL does)


> but we're currently stuck on dealing with a
> copyright requirement of the Unicode group.

I saw a similar post (from a FPC developer) in the Delphi newsgroups.

Regards,
  - Graeme -
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Getting fpcunit test results into a database

2012-09-28 Thread Graeme Geldenhuys
On 2012-09-28 09:18, Reinier Olislagers wrote:
> 
> Is there existing code available for getting fpcunit test results into a
> database?

No, but the Test Listener interface makes such an addition very easy.

Simply create a TDatabaseListener that implements the ITestListener
interface. It's only 5 required methods to implement. Then simply
register that test listener with the testing framework (via
TestResult.AddListener() call), and it will be fed test results as they
happen.

Each of those 5 ITestListerner methods will then insert records into the
database as needed.


Regards,
  - Graeme -

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Getting fpcunit test results into a database

2012-09-28 Thread michael . vancanneyt



On Fri, 28 Sep 2012, Reinier Olislagers wrote:


Hi list,

Is there existing code available for getting fpcunit test results into a
database?

Otherwise I'm thinking of writing an XML importer that gets the test
results and imports them into a database... handy for regression
testing, I'd think.
Looking at the XML, that wouldn't be too difficult... but I'm not really
an (FPC+) XML afficionado...


Why use the XML importer ?

The better way is to write a Unit test listener that directly inserts everything 
in the database.


The XML/TXT/Latex output routines are just specialized listeners.
All you need to do is create a listener that inserts into a database instead
of writing XML/txt/latex...

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] DOM, XMLRead, XMLWrite - cwstring requirement

2012-09-28 Thread michael . vancanneyt



On Fri, 28 Sep 2012, Graeme Geldenhuys wrote:


Hi,

Somebody in the fpGUI support newsgroup raised an issue when using BOM,
XMLRead units under Linux. Does the use of the DOM, XMLRead and XMLWrite
units in FCL (from FPC 2.6.0) require the use of cwstring under Linux?


XMLRead uses it, yes.

We are working on removing this requirement (Inoussa created a native Object
Pascal widestring manager), but we're currently stuck on dealing with a 
copyright requirement of the Unicode group.


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Getting fpcunit test results into a database

2012-09-28 Thread Reinier Olislagers
Hi list,

Is there existing code available for getting fpcunit test results into a
database?

Otherwise I'm thinking of writing an XML importer that gets the test
results and imports them into a database... handy for regression
testing, I'd think.
Looking at the XML, that wouldn't be too difficult... but I'm not really
an (FPC+) XML afficionado...

Thanks,
Reinier
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] DOM, XMLRead, XMLWrite - cwstring requirement

2012-09-28 Thread Graeme Geldenhuys
Hi,

Somebody in the fpGUI support newsgroup raised an issue when using BOM,
XMLRead units under Linux. Does the use of the DOM, XMLRead and XMLWrite
units in FCL (from FPC 2.6.0) require the use of cwstring under Linux?

I'm using those units in the FPTest (Free Pascal Unit Testing Framework)
project to generate XML output and I don't seem to be getting the error
listed below. My projects never have the cwstring unit listed anywhere.

So what else could cause this error message?

--
My code deals with reading/writing XML files (with XMLRead and DOM)
which requires cwstring or else i get an error at runtime:

"This binary has no unicodestrings support compiled in.
Recompile the application with a unicodestrings-manager in the program
uses clause."
--


Regards,
  - Graeme -
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal