Browse Source

+ added unicode video unit test

git-svn-id: branches/unicodekvm@48485 -
nickysn 4 năm trước cách đây
mục cha
commit
ce6260c897

+ 2 - 0
.gitattributes

@@ -8871,6 +8871,8 @@ packages/rtl-console/tests/kbdutil.pp svneol=native#text/plain
 packages/rtl-console/tests/us101.txt svneol=native#text/plain
 packages/rtl-console/tests/video1.pp svneol=native#text/plain
 packages/rtl-console/tests/video1_unix.lpi svneol=native#text/plain
+packages/rtl-console/tests/video2.pp svneol=native#text/plain
+packages/rtl-console/tests/video2_unix.lpi svneol=native#text/plain
 packages/rtl-console/tests/vidutil.pp svneol=native#text/plain
 packages/rtl-extra/Makefile svneol=native#text/plain
 packages/rtl-extra/Makefile.fpc svneol=native#text/plain

+ 28 - 0
packages/rtl-console/tests/video2.pp

@@ -0,0 +1,28 @@
+program video2;
+
+uses
+  video, keyboard;
+
+var
+  k: TKeyEvent;
+  X, Y: Integer;
+begin
+  InitKeyboard;
+  InitEnhancedVideo;
+  repeat
+    for X := 0 to ScreenWidth - 1 do
+      for Y := 0 to ScreenHeight - 1 do
+        with EnhancedVideoBuf[Y * ScreenWidth + X] do
+        begin
+          Attribute := $07;
+          ExtendedGraphemeCluster := WideChar(X + Y);
+        end;
+    UpdateScreen(False);
+
+    k := GetKeyEvent;
+    k := TranslateKeyEvent(k);
+  until GetKeyEventChar(k) = 'q';
+  DoneEnhancedVideo;
+  DoneKeyboard;
+end.
+

+ 71 - 0
packages/rtl-console/tests/video2_unix.lpi

@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="11"/>
+    <General>
+      <Flags>
+        <MainUnitHasCreateFormStatements Value="False"/>
+        <MainUnitHasTitleStatement Value="False"/>
+        <MainUnitHasScaledStatement Value="False"/>
+      </Flags>
+      <SessionStorage Value="InProjectDir"/>
+      <MainUnit Value="0"/>
+      <Title Value="video2"/>
+      <UseAppBundle Value="False"/>
+      <ResourceType Value="res"/>
+    </General>
+    <BuildModes Count="1">
+      <Item1 Name="Default" Default="True"/>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <UseFileFilters Value="True"/>
+    </PublishOptions>
+    <RunParams>
+      <FormatVersion Value="2"/>
+      <Modes Count="0"/>
+    </RunParams>
+    <Units Count="4">
+      <Unit0>
+        <Filename Value="video2.pp"/>
+        <IsPartOfProject Value="True"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="../src/unix/video.pp"/>
+        <IsPartOfProject Value="True"/>
+      </Unit1>
+      <Unit2>
+        <Filename Value="../src/inc/video.inc"/>
+        <IsPartOfProject Value="True"/>
+      </Unit2>
+      <Unit3>
+        <Filename Value="../src/inc/videoh.inc"/>
+        <IsPartOfProject Value="True"/>
+      </Unit3>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <Target>
+      <Filename Value="video2"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir);../src/inc"/>
+      <OtherUnitFiles Value="../src/unix"/>
+      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions Count="3">
+      <Item1>
+        <Name Value="EAbort"/>
+      </Item1>
+      <Item2>
+        <Name Value="ECodetoolError"/>
+      </Item2>
+      <Item3>
+        <Name Value="EFOpenError"/>
+      </Item3>
+    </Exceptions>
+  </Debugging>
+</CONFIG>