Przeglądaj źródła

* new test

git-svn-id: trunk@645 -
peter 20 lat temu
rodzic
commit
61291643d6
2 zmienionych plików z 30 dodań i 0 usunięć
  1. 1 0
      .gitattributes
  2. 29 0
      tests/webtbs/tw4188.pp

+ 1 - 0
.gitattributes

@@ -6143,6 +6143,7 @@ tests/webtbs/tw4151.pp svneol=native#text/plain
 tests/webtbs/tw4152.pp svneol=native#text/plain
 tests/webtbs/tw4155.pp svneol=native#text/plain
 tests/webtbs/tw4162.pp svneol=native#text/plain
+tests/webtbs/tw4188.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain

+ 29 - 0
tests/webtbs/tw4188.pp

@@ -0,0 +1,29 @@
+{ Source provided for Free Pascal Bug Report 4188 }
+{ Submitted by "guy simon" on  2005-07-14 }
+{ e-mail: [email protected] }
+PROGRAM CODESTRING ;
+VAR
+
+ A, B, C : STRING;
+ I, N : BYTE ;
+
+BEGIN
+ RANDSEED := 3455;
+ A :='AZERTYUIOP0123456';
+ N := LENGTH(A);
+ WRITELN('SOURCE STRING : ',A);
+
+{ NOW CODING A INTO B }
+ B := '' ;
+ FOR I := 1 TO N DO B:= B + CHR ( ORD(A[I]) XOR RANDOM(256) );
+ WRITELN('CODED STRING : ',B);
+
+{ NOW DECODING B INTO C}
+ RANDSEED := 3455;
+ C := '';
+ FOR I :=1 TO N DO C:= C + CHR ( ORD(B[I]) XOR RANDOM(256) );
+ WRITELN('DECODED STRING : ',C);
+
+ if C<>A then
+   halt(1);
+END.