From e320e8610ed9d1925b569c47175b0b37e778de0c Mon Sep 17 00:00:00 2001 From: pierre Date: Mon, 3 Apr 2000 15:55:17 +0000 Subject: [PATCH] new files --- tests/webtbs/tbug900.pp | 14 +++++++++++++ tests/webtbs/tbug902.pp | 12 +++++++++++ tests/webtbs/tbug909.pp | 7 +++++++ tests/webtbs/tbug911.pp | 8 ++++++++ tests/webtbs/tbug912.pp | 44 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 85 insertions(+) create mode 100644 tests/webtbs/tbug900.pp create mode 100644 tests/webtbs/tbug902.pp create mode 100644 tests/webtbs/tbug909.pp create mode 100644 tests/webtbs/tbug911.pp create mode 100644 tests/webtbs/tbug912.pp diff --git a/tests/webtbs/tbug900.pp b/tests/webtbs/tbug900.pp new file mode 100644 index 0000000000..8a5fb3cc9f --- /dev/null +++ b/tests/webtbs/tbug900.pp @@ -0,0 +1,14 @@ +program Test; + +uses strings; + +var Str1 : PChar; + +begin + GetMem(Str1,256); + StrPCopy (Str1, ParamStr(0)); + writeln ('Arg 0 is "',Str1,'"'); + StrPCopy (Str1, ParamStr(1)); + writeln ('Arg 1 is "',Str1,'"'); + FreeMem(Str1,256); +end. \ No newline at end of file diff --git a/tests/webtbs/tbug902.pp b/tests/webtbs/tbug902.pp new file mode 100644 index 0000000000..86cecdda98 --- /dev/null +++ b/tests/webtbs/tbug902.pp @@ -0,0 +1,12 @@ +uses + dos; +begin + writeln; + writeln(fsearch('c:\command.com', '')); + { here you get the full path in BP7, but nothing in FPC } + writeln(fsearch('c:\command.com', 'c:\a')); + { I really would not consider this as a bug !! } + { this use of fsearch is not document in BP PM } + if fsearch('c:\command.com', '')<>fsearch('c:\command.com', 'c:\a') then + Writeln('fsearch result is not BP compatible'); +end. \ No newline at end of file diff --git a/tests/webtbs/tbug909.pp b/tests/webtbs/tbug909.pp new file mode 100644 index 0000000000..9aa3aa9d70 --- /dev/null +++ b/tests/webtbs/tbug909.pp @@ -0,0 +1,7 @@ +uses sysutils; + var r:array[0..3] of real; +begin + r[0]:=1; r[1]:=2; r[2]:=3; r[3]:=4; + // the following is supposed to print "1, 2, 3, 4", instead it prints "4, 4, 4, 4" + writeln(format('%g, %g, %g, %g',[r[0],r[1],r[2],r[3]])); +end. \ No newline at end of file diff --git a/tests/webtbs/tbug911.pp b/tests/webtbs/tbug911.pp new file mode 100644 index 0000000000..1643567e07 --- /dev/null +++ b/tests/webtbs/tbug911.pp @@ -0,0 +1,8 @@ +Function Log(const b,r:real):real; +begin + log:=ln(r)/ln(b); +end; + +begin + log(1,5); +end. diff --git a/tests/webtbs/tbug912.pp b/tests/webtbs/tbug912.pp new file mode 100644 index 0000000000..db5ef30c78 --- /dev/null +++ b/tests/webtbs/tbug912.pp @@ -0,0 +1,44 @@ +const + BufSize = 2048; + +var + f : file; + res : longint; + buf : array [0..BufSize-1] of byte; + result : word; +begin +assign(f,paramstr(0)); +{$I-} +reset(f,1); +res:=IOResult; +{$I+} +if res=0 then + Writeln('It is possible to open the executable in Read/Write mode') +else + begin + filemode:=0; + {$I-} + reset(f,1); + res:=IOResult; + {$I+} + if res=0 then + Writeln('It is only possible to open the executable in Read mode') + else + Writeln('It is not possible to open the executable in Read mode'); + end; +if res=0 then + begin +{$I-} + blockread(f,buf,sizeof(buf),result); + res:=IOResult; +{$I+} + if res<>0 then + Writeln('Problem reading executable'); + if res=0 then + close(f) + else + RunError(res); + end +else + RunError(res); +end. \ No newline at end of file