From 1096332975f6ab810907c68d81da77eda60c1bf2 Mon Sep 17 00:00:00 2001 From: carl Date: Tue, 19 Jun 2001 01:49:06 +0000 Subject: [PATCH] + string_string conversion test --- tests/test/cg/tcnvstr1.pp | 74 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 tests/test/cg/tcnvstr1.pp diff --git a/tests/test/cg/tcnvstr1.pp b/tests/test/cg/tcnvstr1.pp new file mode 100644 index 0000000000..f708067eab --- /dev/null +++ b/tests/test/cg/tcnvstr1.pp @@ -0,0 +1,74 @@ +{****************************************************************} +{ CODE GENERATOR TEST PROGRAM } +{****************************************************************} +{ NODE TESTED : secondtypeconvert() -> second_string_string } +{****************************************************************} +{ PRE-REQUISITES: secondload() } +{ secondassign() } +{ secondtypeconv() } +{****************************************************************} +{ DEFINES: } +{ FPC = Target is FreePascal compiler } +{****************************************************************} +{ REMARKS: } +{ } +{ } +{ } +{****************************************************************} + + +{ source: } +{ LOC_REFERENCE, LOC_MEM } +{ destination: } +type + shortstr = string[127]; +var + s1: string[255]; + s2: shortstr; + ansi1: ansistring; +Begin + WriteLn('------------------- ANSI/SHORT ------------------------'); + WriteLn('(left) : LOC_REFERENCE; (right) : LOC_REFERENCE'); + { LOC_REFERENCE -> LOC_REFERENCE test } + { SHORTSTRING -> ANSISTRING } + ansi1 := 'HELLO WORLD'; + s1 := 'HELLO WORLD'; + Write('Value should be ''HELLO WORLD''..'); + if s1 = ansi1 then + WriteLn('Success.') + else + WriteLn('Failure.'); + ansi1 := ''; + s1 := ''; + Write('Value should be ''''...'); + if s1 = ansi1 then + WriteLn('Success.') + else + WriteLn('Failure.'); + { LOC_REFERENCE -> LOC_REFERENCE test } + { SHORTSTRING -> SHORTSTRING } + WriteLn('------------------- SHORT/SHORT ------------------------'); + WriteLn('(left) : LOC_REFERENCE; (right) : LOC_REFERENCE'); + s1 := 'HELLO THIS WORLD'; + s2 := 'HELLO THIS WORLD'; + Write('Value should be ''HELLO THIS WORLD''...'); + if shortstr(s1) = s2 then + WriteLn('Success.') + else + WriteLn('Failure.'); + s1 := ''; + s2 := ''; + Write('Value should be ''''...'); + if shortstr(s1) = s2 then + WriteLn('Success.') + else + WriteLn('Failure.'); +End. + +{ + $Log$ + Revision 1.1 2001-06-19 01:49:06 carl + + string_string conversion test + + +} \ No newline at end of file