tcnvstr1.pp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. {****************************************************************}
  2. { CODE GENERATOR TEST PROGRAM }
  3. {****************************************************************}
  4. { NODE TESTED : secondtypeconvert() -> second_string_string }
  5. {****************************************************************}
  6. { PRE-REQUISITES: secondload() }
  7. { secondassign() }
  8. { secondtypeconv() }
  9. {****************************************************************}
  10. { DEFINES: }
  11. { FPC = Target is FreePascal compiler }
  12. {****************************************************************}
  13. { REMARKS: }
  14. { }
  15. { }
  16. { }
  17. {****************************************************************}
  18. { source: }
  19. { LOC_REFERENCE, LOC_MEM }
  20. { destination: }
  21. type
  22. shortstr = string[127];
  23. var
  24. s1: string[255];
  25. s2: shortstr;
  26. ansi1: ansistring;
  27. Begin
  28. WriteLn('------------------- ANSI/SHORT ------------------------');
  29. WriteLn('(left) : LOC_REFERENCE; (right) : LOC_REFERENCE');
  30. { LOC_REFERENCE -> LOC_REFERENCE test }
  31. { SHORTSTRING -> ANSISTRING }
  32. ansi1 := 'HELLO WORLD';
  33. s1 := 'HELLO WORLD';
  34. Write('Value should be ''HELLO WORLD''..');
  35. if s1 = ansi1 then
  36. WriteLn('Success.')
  37. else
  38. WriteLn('Failure.');
  39. ansi1 := '';
  40. s1 := '';
  41. Write('Value should be ''''...');
  42. if s1 = ansi1 then
  43. WriteLn('Success.')
  44. else
  45. WriteLn('Failure.');
  46. { LOC_REFERENCE -> LOC_REFERENCE test }
  47. { SHORTSTRING -> SHORTSTRING }
  48. WriteLn('------------------- SHORT/SHORT ------------------------');
  49. WriteLn('(left) : LOC_REFERENCE; (right) : LOC_REFERENCE');
  50. s1 := 'HELLO THIS WORLD';
  51. s2 := 'HELLO THIS WORLD';
  52. Write('Value should be ''HELLO THIS WORLD''...');
  53. if shortstr(s1) = s2 then
  54. WriteLn('Success.')
  55. else
  56. WriteLn('Failure.');
  57. s1 := '';
  58. s2 := '';
  59. Write('Value should be ''''...');
  60. if shortstr(s1) = s2 then
  61. WriteLn('Success.')
  62. else
  63. WriteLn('Failure.');
  64. End.
  65. {
  66. $Log$
  67. Revision 1.1 2001-06-19 01:49:06 carl
  68. + string_string conversion test
  69. }