Re: [fpc-pascal] Internal error 200203271

2006-07-14 Thread Marco van de Voort
> Marco van de Voort wrote:
> > units\arm-linux\libpgdk2.a
> > units\arm-linux\gdk2.sl
> > gtkspinbutton.inc(267,4) Fatal: Internal error 200203271
> >   $004DF30F  SECONDPASS,  line 175 of pass_2.pas
> >   $0049DA27  DO_GENERATE_CODE,  line 1274 of psub.pas
> >   $0049DFD9  READ_DECLARATIONS,  line 1584 of psub.pas
> >   $00447E2D  COMPILE,  line 422 of parser.pas
> >   $0049122A  TPPUMODULE__LOADPPU,  line 1411 of fppu.pas
> >   $00499C5F  LOADUNITS,  line 602 of pmodules.pas
> >   $0049A55A  PROC_UNIT,  line 918 of pmodules.pas
> >   $00447E2D  COMPILE,  line 422 of parser.pas
> >   $0041C985  COMPILE,  line 375 of compiler.pas
> > Fatal: Compilation aborted
> > Max Memory used/heapsize: 33.348/34.304 Kb
> > make[5]: *** [buildgtk2.ppu] Error 1
> > make[5]: Leaving directory :/repo/fpcex/packages/extra/gtk2'
> > make[4]: *** [fpc_smart] Error 2
> > make[4]: Leaving directory :/repo/fpcex/packages/extra/gtk2'
> > make[3]: *** [gtk2_smart] Error 2
> > make[3]: Leaving directory :/repo/fpcex/packages/extra'
> > make[2]: *** [extra_smart] Error 2
> > make[2]: Leaving directory :/repo/fpcex/packages'
> > make[1]: *** [packages_extra_smart] Error 2
> > make[1]: Leaving directory :/repo/fpcex'
> > make: *** [build-stamp.arm-linux] Error 2
> >   
> 
> Is there any progress on this?  I tried to debug it last night (getting 
> a similar callstack to the above), but my skills with gdb are extremely 
> lacking.

No, not that I know.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] fpcUnit testing Exceptions

2006-07-14 Thread Graeme Geldenhuys

Hi,

Is it possible to test the code below using the AssertException()
call?  I am sure it must be, I am just not sure how to use it.

This is the work-around I have now, untill I can figure out how to use
AssertException() correctly.

 try
   si.SetSlideName('006~sa.swf');
   si.SlideTypeDB;  { <<== method raises an error if type unknown }
 except
   on E: exception do
   begin
 AssertEquals('Failing on 3', EUnknownSlideType.ClassName, E.ClassName);
   end;
 end;


I tried the following, but got a compiler error on each one.

-
 si.SetSlideName('006~sa.swf');
 { none of the following worked... }
 AssertException('Failing on 3', EUnknownSlideType, @si.SlideTypeDB);
 AssertException('Failing on 3', EUnknownSlideType, [EMAIL PROTECTED]);
 AssertException('Failing on 3', EUnknownSlideType, si.^SlideTypeDB);
-

Regards,
 Graeme.


--
There's no place like 127.0.0.1
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpcUnit testing Exceptions

2006-07-14 Thread dhkblaszyk
Graeme,

I would try and test this:

AssertException('Failing on 3', EUnknownSlideType,
TRunMethod(@si.SlideTypeDB));

Haven't been able to test though, but it's what comes to mind. Perhaps it
helps.

Darius


> Hi,
>
> Is it possible to test the code below using the AssertException()
> call?  I am sure it must be, I am just not sure how to use it.
>
> This is the work-around I have now, untill I can figure out how to use
> AssertException() correctly.
> 
>   try
> si.SetSlideName('006~sa.swf');
> si.SlideTypeDB;  { <<== method raises an error if type unknown }
>   except
> on E: exception do
> begin
>   AssertEquals('Failing on 3', EUnknownSlideType.ClassName,
> E.ClassName);
> end;
>   end;
> 
>
> I tried the following, but got a compiler error on each one.
>
> -
>   si.SetSlideName('006~sa.swf');
>   { none of the following worked... }
>   AssertException('Failing on 3', EUnknownSlideType, @si.SlideTypeDB);
>   AssertException('Failing on 3', EUnknownSlideType, [EMAIL PROTECTED]);
>   AssertException('Failing on 3', EUnknownSlideType, si.^SlideTypeDB);
> -
>
> Regards,
>   Graeme.
>
>
> --
> There's no place like 127.0.0.1
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>


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


[fpc-pascal] Porting DOS Program

2006-07-14 Thread Rainer Stratmann
Hi,

is it possible in X (Linux) to "lock the screen" and then to put the screen in 
a fullscreenmode (800 x 600 x 32Bit) and then have access to the framebuffer 
memory like in DOS?

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


Re: [fpc-pascal] Porting DOS Program

2006-07-14 Thread Michael Van Canneyt



On Fri, 14 Jul 2006, Rainer Stratmann wrote:


Hi,

is it possible in X (Linux) to "lock the screen" and then to put the screen in
a fullscreenmode (800 x 600 x 32Bit) and then have access to the framebuffer
memory like in DOS?


Not like that.
You should use a DRI (Direct Rendering Interface) interface or something like 
it.

You could try to use the framebuffer interface of the kernel, but that
will work on the console only.

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


Re: [fpc-pascal] fpcUnit testing Exceptions

2006-07-14 Thread Graeme Geldenhuys

I would try and test this:

AssertException('Failing on 3', EUnknownSlideType,
TRunMethod(@si.SlideTypeDB));


It gives a "Variable identifier expected" just before the dot.

I even tried putting the si.SlideTypeDB inside a Local Procedure and
passing @ but that also didn't work.  :-(

Example

procedue Testcase;
   procedure LocalCall;
   begin
 si.SlideTypeDB;
   end
begin
  AssertException('Failing on 3', EUnknownSlideType, @LocalCall);
end;


Graeme.

--
There's no place like 127.0.0.1
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpcUnit testing Exceptions

2006-07-14 Thread Dean Zobec
Graeme Geldenhuys wrote:
> Hi,
> 
> Is it possible to test the code below using the AssertException()
> call?  I am sure it must be, I am just not sure how to use it.
> 
> This is the work-around I have now, untill I can figure out how to use
> AssertException() correctly.
> 
>  try
>si.SetSlideName('006~sa.swf');
>si.SlideTypeDB;  { <<== method raises an error if type unknown }
>  except
>on E: exception do
>begin
>  AssertEquals('Failing on 3', EUnknownSlideType.ClassName,
> E.ClassName);
>end;
>  end;
> 
> 
> I tried the following, but got a compiler error on each one.
> 
> -
>  si.SetSlideName('006~sa.swf');
>  { none of the following worked... }
>  AssertException('Failing on 3', EUnknownSlideType, @si.SlideTypeDB);
>  AssertException('Failing on 3', EUnknownSlideType, [EMAIL PROTECTED]);
>  AssertException('Failing on 3', EUnknownSlideType, si.^SlideTypeDB);
> -

from the FPCUnit code:

class procedure AssertException(const AMessage: string; AExceptionClass:
ExceptClass; AMethod: TRunMethod); overload;

where
TRunMethod = procedure of object;

How is SlideTypeDB defined?

the correct way should be

AssertException('Failing on 3', EUnknownSlideType, @si.SlideTypeDB);

provided SlideTypeDB is a simple procedure with no parameters
and you are using
{$mode objfpc}

See the examples and the tests in the fcl/fpcunit directory on how to
use AssertException

Btw, there is an elegant way to test that a proper exception is raised
without using AssertException e.g. (from fcl/fpcunit/tests/asserttest.pp):

procedure TAssertTest.TestAssertNull;
var
  obj: TObject;
begin
  AssertNull(nil);
  obj := TObject.Create;
  try
AssertNull(obj);
  except
on E: EAssertionFailedError do
begin
  obj.Free;
  Exit;
end;
  end;
  obj.Free;
  Fail('failure: obj is not null!');
end;

Ciao,
Dean



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


Re: [fpc-pascal] Using the interrupt keyword in FPC for DOS

2006-07-14 Thread Tomas Hajny
On 13 Jul 06, at 23:48, Andreas Berger wrote:

> FPC has the interrupt keyword on GO32V2. Is this the same as that
> used in TP/BP?

Yes, it should be.


> There I could declare an interrupt function 
like: 
> procedure ISR(Flags, CS, IP, AX, BX, CX, DX,| SI, DI, DS, ES, BP :
> WORD); interrupt; 
> 
> Is this the same in FPC? In what order are the register variables?

No idea. You don't need to specify the registers, 
do you? Anyway, searching for "FPC interrupt 
keyword" via Google finds some possibly useful 
messages in our mailing list archives (from year 
2000).

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