mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 14:29:25 +02:00
+ add a test that check for correct functionality of all the SwapEndian() overloads
This commit is contained in:
parent
397745f49a
commit
98fc58b229
31
tests/test/tendian2.pp
Normal file
31
tests/test/tendian2.pp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
program tendian;
|
||||||
|
|
||||||
|
var
|
||||||
|
i16: Int16;
|
||||||
|
i32: Int32;
|
||||||
|
i64: Int64;
|
||||||
|
u16: UInt16;
|
||||||
|
u32: UInt32;
|
||||||
|
u64: UInt64;
|
||||||
|
begin
|
||||||
|
i16 := $1234;
|
||||||
|
i32 := $12345678;
|
||||||
|
i64 := $1234567843218765;
|
||||||
|
u16 := $1234;
|
||||||
|
u32 := $12345678;
|
||||||
|
u64 := $1234567843218765;
|
||||||
|
|
||||||
|
if SwapEndian(i16) <> $3412 then
|
||||||
|
Halt(1);
|
||||||
|
if SwapEndian(i32) <> $78563412 then
|
||||||
|
Halt(2);
|
||||||
|
if SwapEndian(i64) <> $6587214378563412 then
|
||||||
|
Halt(3);
|
||||||
|
|
||||||
|
if SwapEndian(u16) <> $3412 then
|
||||||
|
Halt(4);
|
||||||
|
if SwapEndian(u32) <> $78563412 then
|
||||||
|
Halt(5);
|
||||||
|
if SwapEndian(u64) <> $6587214378563412 then
|
||||||
|
Halt(6);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user