]> O.S.I.I.S - jp/crow.git/commitdiff
update NUnit tests
authorjpbruyere <jp.bruyere@hotmail.com>
Wed, 10 Feb 2016 10:00:19 +0000 (11:00 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Wed, 10 Feb 2016 10:00:19 +0000 (11:00 +0100)
13 files changed:
UnitTest/ExpectedOutputs/0.png
UnitTest/ExpectedOutputs/1.png
UnitTest/ExpectedOutputs/3.png [new file with mode: 0644]
UnitTest/ExpectedOutputs/4.png [new file with mode: 0644]
UnitTest/ExpectedOutputs/5.png [new file with mode: 0644]
UnitTest/Interfaces/3.crow [new file with mode: 0755]
UnitTest/Interfaces/4.crow [new file with mode: 0755]
UnitTest/Interfaces/5.crow [new file with mode: 0755]
UnitTest/Interfaces/testImage.crow [deleted file]
UnitTest/Interfaces/testStacks.crow [deleted file]
UnitTest/NUnitCrowWindow.cs
UnitTest/Test.cs
UnitTest/UnitTest.csproj

index acf96fa65b9b82b04689ca1bc7894770c62d8a1d..153a364177a2cb401af45a543597a5db1d269cfc 100644 (file)
Binary files a/UnitTest/ExpectedOutputs/0.png and b/UnitTest/ExpectedOutputs/0.png differ
index f792986c8381ddf1ed9a91e7bde55c0fe3d70477..57fcf77ea4f20431b2c3c54ac22bbdf4779e478d 100644 (file)
Binary files a/UnitTest/ExpectedOutputs/1.png and b/UnitTest/ExpectedOutputs/1.png differ
diff --git a/UnitTest/ExpectedOutputs/3.png b/UnitTest/ExpectedOutputs/3.png
new file mode 100644 (file)
index 0000000..e3ada0f
Binary files /dev/null and b/UnitTest/ExpectedOutputs/3.png differ
diff --git a/UnitTest/ExpectedOutputs/4.png b/UnitTest/ExpectedOutputs/4.png
new file mode 100644 (file)
index 0000000..c2e97e7
Binary files /dev/null and b/UnitTest/ExpectedOutputs/4.png differ
diff --git a/UnitTest/ExpectedOutputs/5.png b/UnitTest/ExpectedOutputs/5.png
new file mode 100644 (file)
index 0000000..e228e9a
Binary files /dev/null and b/UnitTest/ExpectedOutputs/5.png differ
diff --git a/UnitTest/Interfaces/3.crow b/UnitTest/Interfaces/3.crow
new file mode 100755 (executable)
index 0000000..7dce3c8
--- /dev/null
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+<HorizontalStack Margin="5" Background="DimGray">
+       <VerticalStack Width="200" Margin="5" Background="Gray">
+               <VerticalStack Fit="true" Background="DimGray" Margin="5">
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+               </VerticalStack>
+               <VerticalStack Width="0" Height="-1" Background="DimGray" Margin="5">
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue" Width="0"/>
+                       <TextRun Background="SkyBlue" Height="0"/>
+               </VerticalStack>
+               <HorizontalStack Fit="true" Background="DimGray" Margin="5">
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+               </HorizontalStack>
+               <HorizontalStack Width="0" Height="-1" Background="DimGray" Margin="5">
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+               </HorizontalStack>
+                       <HorizontalStack Width="0" Height="0" Background="DimGray" Margin="5">
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue" Width="0"/>
+                       <TextRun Background="SkyBlue"/>
+               </HorizontalStack>
+       </VerticalStack>
+       <VerticalStack Width="0" Height="0" Margin="5" Background="Gray">
+               <VerticalStack Fit="true" Background="DimGray" Margin="5">
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+               </VerticalStack>
+               <VerticalStack Width="0" Height="0" Background="DimGray" Margin="5">
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue" Width="0"/>
+                       <TextRun TextAlignment="Center" Background="SkyBlue" Width="0" Height="0"/>
+               </VerticalStack>
+               <HorizontalStack Fit="true" Background="DimGray" Margin="5">
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+               </HorizontalStack>
+               <HorizontalStack Width="0" Height="-1" Background="DimGray" Margin="5">
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+               </HorizontalStack>
+                       <HorizontalStack Width="0" Height="-1" Background="DimGray" Margin="5">
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue" Width="0"/>
+                       <TextRun Background="SkyBlue"/>
+               </HorizontalStack>
+       </VerticalStack>
+       <VerticalStack Width="-1" Margin="5" Background="Gray">
+               <VerticalStack Width="0" Height="-1" Background="DimGray" Margin="5">
+                       <TextRun Background="SkyBlue" HorizontalAlignment="Left"/>
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+               </VerticalStack>
+               <VerticalStack Width="0" Height="-1" Background="DimGray" Margin="5">
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue" Width="0"/>
+                       <TextRun Background="SkyBlue" Height="0"/>
+               </VerticalStack>
+               <HorizontalStack Fit="true" Background="DimGray" Margin="5">
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+               </HorizontalStack>
+               <HorizontalStack Width="0" Height="-1" Background="DimGray" Margin="5">
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue"/>
+               </HorizontalStack>
+                       <HorizontalStack Width="0" Height="0" Background="DimGray" Margin="5">
+                       <TextRun Background="SkyBlue"/>
+                       <TextRun Background="SkyBlue" Width="0"/>
+                       <TextRun Background="SkyBlue"/>
+               </HorizontalStack>
+       </VerticalStack>
+</HorizontalStack>
\ No newline at end of file
diff --git a/UnitTest/Interfaces/4.crow b/UnitTest/Interfaces/4.crow
new file mode 100755 (executable)
index 0000000..3b6efa0
--- /dev/null
@@ -0,0 +1,81 @@
+<?xml version="1.0"?>
+<VerticalStack Fit="true" Spacing="0">
+       <Label Text="SCALED PROPORTIONNAL" Background="hgradient|0:DimGray|1:DarkRed" Width="0"/>
+       <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" >
+               <Image Background="vgradient|0:SkyBlue|1:White" Path="#Crow.image.crow0.svg"/>
+               <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Path="#Crow.image.crow0.svg" />
+               <Image Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Crow.image.crow0.svg" />
+               <Image Margin="2" Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Crow.image.crow0.svg" />
+               <Image Background="vgradient|0:SkyBlue|1:White" Width="25" Height="50" Path="#Crow.image.crow0.svg" />
+               <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="50" Path="#Crow.image.crow0.svg" />
+               <Image Background="vgradient|0:SkyBlue|1:White" Width="50" Height="25" Path="#Crow.image.crow0.svg" />
+               <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="50" Height="25" Path="#Crow.image.crow0.svg" />
+               <Image Background="vgradient|0:SkyBlue|1:White" Width="25" Height="-1" Path="#Crow.image.crow0.svg" />
+               <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="-1" Path="#Crow.image.crow0.svg" />
+       </HorizontalStack>
+       <Label Text="SCALED NOT PROPORTIONNAL" Background="hgradient|0:DimGray|1:DarkRed"/>
+       <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" >
+               <Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Path="#Crow.image.crow0.svg" />
+               <Image KeepProportions="false" Margin="10" Background="vgradient|0:SkyBlue|1:White" Path="#Crow.image.crow0.svg" />
+               <Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Crow.image.crow0.svg" />
+               <Image KeepProportions="false" Margin="2" Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Crow.image.crow0.svg" />
+               <Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="50" Path="#Crow.image.crow0.svg" />
+               <Image KeepProportions="false" Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="50" Path="#Crow.image.crow0.svg" />
+               <Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Width="50" Height="25" Path="#Crow.image.crow0.svg" />
+               <Image KeepProportions="false" Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="50" Height="25" Path="#Crow.image.crow0.svg" />
+               <Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="-1" Path="#Crow.image.crow0.svg" />
+               <Image KeepProportions="false" Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="-1" Path="#Crow.image.crow0.svg" />
+       </HorizontalStack>
+       <Label Text="UNSCALED" Background="hgradient|0:DimGray|1:DarkRed"/>
+       <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" >
+               <Image Scaled="false" Background="Blue" Path="#Crow.image.crow0.svg" />
+               <Image Scaled="false" Margin="10" Background="Blue" Path="#Crow.image.crow0.svg" />
+               <Image Scaled="false" Background="Blue" Width="20" Height="20" Path="#Crow.image.crow0.svg" />
+               <Image Scaled="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.image.crow0.svg" />
+               <Image Scaled="false" Background="Blue" Width="25" Height="50" Path="#Crow.image.crow0.svg" />
+               <Image Scaled="false" Margin="10" Background="Blue" Width="25" Height="50" Path="#Crow.image.crow0.svg" />
+               <Image Scaled="false" Background="Blue" Width="50" Height="25" Path="#Crow.image.crow0.svg" />
+               <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="25" Path="#Crow.image.crow0.svg" />
+               <Image Scaled="false" Background="Blue" Width="25" Height="-1" Path="#Crow.image.crow0.svg" />
+               <Image Scaled="false" Margin="10" Background="Blue" Width="25" Height="-1" Path="#Crow.image.crow0.svg" />
+       </HorizontalStack>
+       <Label Text="SCALED PROPORTIONNAL" Background="hgradient|0:DimGray|1:DarkRed"/>
+       <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent">
+               <Image Background="Blue" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Margin="10" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Margin="10" Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Margin="10" Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Background="Blue" Width="25" Height="-1" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Margin="10" Background="Blue" Width="25" Height="-1" Path="#Crow.Images.Icons.tetra.png"/>
+       </HorizontalStack>
+       <Label Text="SCALED NOT PROPORTIONNAL" Background="hgradient|0:DimGray|1:DarkRed"/>
+       <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent">             
+               <Image KeepProportions="false" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image KeepProportions="false" Margin="10" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image KeepProportions="false" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image KeepProportions="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image KeepProportions="false" Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image KeepProportions="false" Margin="10" Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image KeepProportions="false" Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image KeepProportions="false" Background="Blue" Width="25" Height="-1" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image KeepProportions="false" Margin="10" Background="Blue" Width="25" Height="-1" Path="#Crow.Images.Icons.tetra.png"/>
+       </HorizontalStack>
+       <Label Text="UNSCALED" Background="hgradient|0:DimGray|1:DarkRed"/>
+       <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" >
+               <Image Scaled="false" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Scaled="false" Margin="10" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Scaled="false" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Scaled="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Scaled="false" Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Scaled="false" Margin="10" Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Scaled="false" Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Scaled="false" Background="Blue" Width="25" Height="-1" Path="#Crow.Images.Icons.tetra.png"/>
+               <Image Scaled="false" Margin="10" Background="Blue" Width="25" Height="-1" Path="#Crow.Images.Icons.tetra.png"/>
+       </HorizontalStack>
+</VerticalStack>
\ No newline at end of file
diff --git a/UnitTest/Interfaces/5.crow b/UnitTest/Interfaces/5.crow
new file mode 100755 (executable)
index 0000000..a4d950b
--- /dev/null
@@ -0,0 +1,64 @@
+<?xml version="1.0"?>
+<HorizontalStack Fit="true" Margin="5">
+       <VerticalStack Fit="true" Margin="2" Spacing="2">
+               <TextRun Text="text run test"/>
+               <Label Text="label test"/>
+               <TextBox Text="text box test"/>
+               <Button Caption="test button"/>
+               <CheckBox Caption="test checkbox"/>
+               <RadioButton Caption="test radiobutton"/>
+               <ComboBox/>
+               <Popper Caption="test popper">
+                       <Label Text="label test"/>
+               </Popper>
+               <Expandable Caption="test expandable">
+                       <Label Text="label test"/>
+               </Expandable>
+               <Border >
+                       <Label Text="border test" Margin="3"/>
+               </Border>
+               <GroupBox Caption="Group box" >
+                       <Label Text="border test" Margin="3"/>
+               </GroupBox>
+               <Container Fit="true" Background="DimGray" Margin="3">
+                       <GraphicObject Width="20" Height="20" Background="LightGray"/>
+               </Container>
+               <ProgressBar Height="10" Width="150" Background="DimGray" Value="50" />
+               <Slider Value="5" Width="150" Height="10"/>
+               <ScrollBar Orientation="Horizontal" Maximum="100" Value="50" Height="16" Width="150"/>
+               <Spinner Value="100"/>
+       </VerticalStack>
+       <VerticalStack Width="150" Height="-1" Margin="2" Spacing="2">
+               <TextRun Text="text run test" Width="0"/>
+               <Label Text="label test" Width="0"/>
+               <TextBox Text="text box test" Width="0"/>
+               <Button Caption="test button" Width="0"/>
+               <CheckBox Caption="test checkbox" Width="0"/>
+               <RadioButton Caption="test radiobutton" Width="0"/>
+               <ComboBox Width="0"/>
+               <Popper Caption="test popper" Width="0">
+                       <Label Text="label test"/>
+               </Popper>
+               <Expandable Caption="test expandable" Width="0">
+                       <Label Text="label test"/>
+               </Expandable>
+               <Border  Width="0">
+                       <Label Text="border test" Margin="3"/>
+               </Border>
+               <GroupBox Caption="Group box"  Width="0">
+                       <Label Text="border test" Margin="3"/>
+               </GroupBox>
+               <Container Height="-1"  Width="0" Background="DimGray" Margin="3">
+                       <GraphicObject Width="20" Height="20" Background="LightGray"/>
+               </Container>
+               <ProgressBar Height="10" Width="0" Background="DimGray" Value="50" />
+               <Slider Value="5" Width="0" Height="10"/>
+               <ScrollBar Orientation="Horizontal" Maximum="100" Value="50" Height="16" Width="0"/>
+               <Spinner Value="100"  Width="0"/>
+       </VerticalStack>
+</HorizontalStack>
+<!--<HorizontalStack Fit="true" Background="BlueCrayola" Margin="5">
+       <GraphicObject Background="Red" Width="30" Height="20"/>
+       <Spinner Maximum="10000000000" SmallIncrement="10" Value="0"/>
+       <GraphicObject Background="Green" Width="30" Height="20"/>
+</HorizontalStack>-->
\ No newline at end of file
diff --git a/UnitTest/Interfaces/testImage.crow b/UnitTest/Interfaces/testImage.crow
deleted file mode 100755 (executable)
index 1939982..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0"?>
-<VerticalStack Fit="true">
-       <HorizontalStack Fit="true" Background="Red" Margin="5">
-               <Label Text="SCALED PROPORTIONNAL" Width="150"/>
-               <Image Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Margin="10" Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Margin="10" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Margin="10" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Margin="10" Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-       </HorizontalStack>
-       <HorizontalStack Fit="true" Background="Red" Margin="5">
-               <Label Text="SCALED NOT PROPORTIONNAL" Width="150"/>
-               <Image KeepProportions="false" Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image KeepProportions="false" Margin="10" Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image KeepProportions="false" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image KeepProportions="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image KeepProportions="false" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image KeepProportions="false" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image KeepProportions="false" Margin="10" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image KeepProportions="false" Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-       </HorizontalStack>
-       <HorizontalStack Fit="true" Background="Red" Margin="5">
-               <Label Text="UNSCALED" Width="150"/>
-               <Image Scaled="false" Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Scaled="false" Margin="10" Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Scaled="false" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Scaled="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Scaled="false" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Scaled="false" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Scaled="false" Margin="10" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Scaled="false" Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-               <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-       </HorizontalStack>
-       <HorizontalStack Fit="true" Background="Red" Margin="5">
-               <Label Text="SCALED PROPORTIONNAL" Width="150"/>
-               <Image Background="Blue" Path="#Tests.image.tetra.png"/>
-               <Image Margin="10" Background="Blue" Path="#Tests.image.tetra.png"/>
-               <Image Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
-               <Image Margin="2" Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
-               <Image Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
-               <Image Margin="10" Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
-               <Image Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
-               <Image Margin="10" Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
-               <Image Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
-               <Image Margin="10" Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
-       </HorizontalStack>
-       <HorizontalStack Fit="true" Background="Red" Margin="5">
-               <Label Text="SCALED NOT PROPORTIONNAL" Width="150"/>
-               <Image KeepProportions="false" Background="Blue" Path="#Tests.image.tetra.png"/>
-               <Image KeepProportions="false" Margin="10" Background="Blue" Path="#Tests.image.tetra.png"/>
-               <Image KeepProportions="false" Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
-               <Image KeepProportions="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
-               <Image KeepProportions="false" Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
-               <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
-               <Image KeepProportions="false" Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
-               <Image KeepProportions="false" Margin="10" Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
-               <Image KeepProportions="false" Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
-               <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
-       </HorizontalStack>
-       <HorizontalStack Fit="true" Background="Red" Margin="5">
-               <Label Text="UNSCALED" Width="150"/>
-               <Image Scaled="false" Background="Blue" Path="#Tests.image.tetra.png"/>
-               <Image Scaled="false" Margin="10" Background="Blue" Path="#Tests.image.tetra.png"/>
-               <Image Scaled="false" Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
-               <Image Scaled="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
-               <Image Scaled="false" Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
-               <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
-               <Image Scaled="false" Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
-               <Image Scaled="false" Margin="10" Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
-               <Image Scaled="false" Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
-               <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
-       </HorizontalStack>
-</VerticalStack>
\ No newline at end of file
diff --git a/UnitTest/Interfaces/testStacks.crow b/UnitTest/Interfaces/testStacks.crow
deleted file mode 100755 (executable)
index 7dce3c8..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0"?>
-<HorizontalStack Margin="5" Background="DimGray">
-       <VerticalStack Width="200" Margin="5" Background="Gray">
-               <VerticalStack Fit="true" Background="DimGray" Margin="5">
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-               </VerticalStack>
-               <VerticalStack Width="0" Height="-1" Background="DimGray" Margin="5">
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue" Width="0"/>
-                       <TextRun Background="SkyBlue" Height="0"/>
-               </VerticalStack>
-               <HorizontalStack Fit="true" Background="DimGray" Margin="5">
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-               </HorizontalStack>
-               <HorizontalStack Width="0" Height="-1" Background="DimGray" Margin="5">
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-               </HorizontalStack>
-                       <HorizontalStack Width="0" Height="0" Background="DimGray" Margin="5">
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue" Width="0"/>
-                       <TextRun Background="SkyBlue"/>
-               </HorizontalStack>
-       </VerticalStack>
-       <VerticalStack Width="0" Height="0" Margin="5" Background="Gray">
-               <VerticalStack Fit="true" Background="DimGray" Margin="5">
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-               </VerticalStack>
-               <VerticalStack Width="0" Height="0" Background="DimGray" Margin="5">
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue" Width="0"/>
-                       <TextRun TextAlignment="Center" Background="SkyBlue" Width="0" Height="0"/>
-               </VerticalStack>
-               <HorizontalStack Fit="true" Background="DimGray" Margin="5">
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-               </HorizontalStack>
-               <HorizontalStack Width="0" Height="-1" Background="DimGray" Margin="5">
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-               </HorizontalStack>
-                       <HorizontalStack Width="0" Height="-1" Background="DimGray" Margin="5">
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue" Width="0"/>
-                       <TextRun Background="SkyBlue"/>
-               </HorizontalStack>
-       </VerticalStack>
-       <VerticalStack Width="-1" Margin="5" Background="Gray">
-               <VerticalStack Width="0" Height="-1" Background="DimGray" Margin="5">
-                       <TextRun Background="SkyBlue" HorizontalAlignment="Left"/>
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-               </VerticalStack>
-               <VerticalStack Width="0" Height="-1" Background="DimGray" Margin="5">
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue" Width="0"/>
-                       <TextRun Background="SkyBlue" Height="0"/>
-               </VerticalStack>
-               <HorizontalStack Fit="true" Background="DimGray" Margin="5">
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-               </HorizontalStack>
-               <HorizontalStack Width="0" Height="-1" Background="DimGray" Margin="5">
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue"/>
-               </HorizontalStack>
-                       <HorizontalStack Width="0" Height="0" Background="DimGray" Margin="5">
-                       <TextRun Background="SkyBlue"/>
-                       <TextRun Background="SkyBlue" Width="0"/>
-                       <TextRun Background="SkyBlue"/>
-               </HorizontalStack>
-       </VerticalStack>
-</HorizontalStack>
\ No newline at end of file
index 40f79480d8d412b946a7a2e53b23ba37fc38fa6a..f0879dd955bc8bd0b7f484502dfeb645a09139b2 100644 (file)
@@ -14,6 +14,7 @@ using System.Threading;
 using System.Collections.Generic;
 using System.Linq;
 using Cairo;
+using System.IO;
 
 
 namespace Crow
@@ -148,19 +149,15 @@ namespace Crow
                        GraphicObjects.CopyTo (invGOList,0);
                        invGOList = invGOList.Reverse ().ToArray ();
 
-                       //Debug.WriteLine ("======= Layouting queue start =======");
-                               while (Interface.LayoutingQueue.First != null) {
-                                       //                                      Stopwatch lqiProcTime = new Stopwatch ();
-                                       //                                      lqiProcTime.Start ();
-                                       LayoutingQueueItem lqi = Interface.LayoutingQueue.Dequeue ();
-                                       lqi.ProcessLayouting ();
-                                       //                                      lqiProcTime.Stop ();
-                                       //                                      if (lqiProcTime.ElapsedMilliseconds > 10) {
-                                       //                                              Debug.WriteLine("lqi {2}: {0} ticks \t, {1} ms",
-                                       //                                                      updateTime.ElapsedTicks,
-                                       //                                                      updateTime.ElapsedMilliseconds, lqi.ToString());
-                                       //                                      }
-                               }
+
+                       layoutTime.Start ();
+
+                       while (Interface.LayoutingQueue.Count > 0) {
+                               LayoutingQueueItem lqi = Interface.LayoutingQueue.Dequeue ();
+                               lqi.ProcessLayouting ();
+                       }
+
+                       layoutTime.Stop ();
 
                        //final redraw clips should be added only when layout is completed among parents,
                        //that's why it take place in a second pass
@@ -171,7 +168,7 @@ namespace Crow
                                p.registerClipRect ();
                        }
 
-                       layoutTime.Stop ();
+
                        guTime.Start ();
 
                        lock (redrawClip) {
@@ -208,17 +205,20 @@ namespace Crow
                        guTime.Stop ();
                        updateTime.Stop ();
                        ctx.Dispose ();
-                       Console.WriteLine("{3} => layout:{0,8} t\tdraw:{1,8} t\tupdate:{2,8} t",
-                           layoutTime.ElapsedTicks,
-                           guTime.ElapsedTicks,
-                           updateTime.ElapsedTicks,
+
+                       sw.WriteLine ("{3}\t{0,8}\t{1,8}\t{2,8}",
+                               layoutTime.ElapsedTicks,
+                               guTime.ElapsedTicks,
+                               updateTime.ElapsedTicks,
                                testId);
+                       sw.Flush ();
+                       
 //                     Console.WriteLine("{3} => layout:{0}ms\tdraw{1}ms\tupdate:{2}ms",
 //                             layoutTime.ElapsedMilliseconds,
 //                             guTime.ElapsedMilliseconds,
 //                             updateTime.ElapsedMilliseconds,
 //                             testId);
-                       surf.WriteToPng (@"ExpectedOutputs/" + testId + ".png");
+                       //surf.WriteToPng (@"ExpectedOutputs/" + testId + ".png");
                        surf.WriteToPng (@"tmp.png");
                }                                               
                #endregion
@@ -244,17 +244,30 @@ namespace Crow
                }
                #endregion
 
+               #region CTOR
                public NUnitCrowWindow (int width, int height)
                {
                        ClientRectangle.Width = width;
                        ClientRectangle.Height = height;
 
                        surf = new ImageSurface(Format.Argb32, ClientRectangle.Width, ClientRectangle.Height);
+                       string path = "crow-" + DateTime.Now + ".txt";
+
+                       sw = new StreamWriter (path);
+
+                       sw.WriteLine ("ID        layout            draw          update");
+                       sw.WriteLine ("------------------------------------------------");
+                       sw.Flush ();
+               }
+               ~NUnitCrowWindow(){
+                       
+                       sw.Close ();
                }
+               #endregion
 
                int frameCpt = 0;
                int idx = 0;
-
+               StreamWriter sw;
 
                #region FPS
                int _fps = 0;
@@ -414,35 +427,37 @@ namespace Crow
                #endregion
 
                #region ILayoutable implementation
-
-               //TODO:uneeded list, should be removed
-               public List<LinkedListNode<LayoutingQueueItem>> RegisteredLQINodes { get; } = new List<LinkedListNode<LayoutingQueueItem>>();
-               public void RegisterForLayouting (int layoutType) { throw new NotImplementedException (); }
-               public void UpdateLayout (LayoutingType layoutType) { throw new NotImplementedException (); }
-               public Rectangle ContextCoordinates (Rectangle r)
+               public void RegisterForLayouting (LayoutingType layoutType)
                {
-                       return r;
+                       throw new NotImplementedException ();
+               }                       
+               public int LayoutingTries {
+                       get { throw new NotImplementedException (); }
+                       set { throw new NotImplementedException (); }
+               }
+               public ILayoutable LogicalParent {
+                       get { return null; }
+                       set { throw new NotImplementedException (); }
+               }
+               public ILayoutable Parent {
+                       get { return null; }
+                       set { throw new NotImplementedException (); }
+               }
+               public LayoutingType RegisteredLayoutings {
+                       get { return LayoutingType.None; }
+                       set { throw new NotImplementedException (); } 
                }
+               public void RegisterForLayouting (int layoutType) { throw new NotImplementedException (); }
+               public bool UpdateLayout (LayoutingType layoutType) { throw new NotImplementedException (); }
+               public Rectangle ContextCoordinates (Rectangle r) => r;
                public Rectangle ScreenCoordinates (Rectangle r)
                {
                        return r;
                }
-
-               public ILayoutable Parent {
-                       get {
-                               return null;
-                       }
-                       set {
-                               throw new NotImplementedException ();
-                       }
-               }
                Rectangle ILayoutable.ClientRectangle {
                        get { return new Size(this.ClientRectangle.Size.Width,this.ClientRectangle.Size.Height); }
                }
-               public IGOLibHost HostContainer {
-                       get { return this; }
-               }
-
+               public IGOLibHost HostContainer { get { return this; }}
                public Rectangle getSlot ()
                {
                        return ClientRectangle;
index 115556968683577b373ca1a9c827b3bbe2455ca7..0ef57d7859c7faa5a261aaa5b2595a9a179c2f73 100644 (file)
@@ -33,14 +33,14 @@ namespace UnitTest
                [SetUp]
                public void Init()
                {
-                       win = new NUnitCrowWindow (400,400);
+                       win = new NUnitCrowWindow (600,600);
                }
 
                [Test ()]
                [Category("Alignment")]
                public void GraphicObject ()
                {
-                       string[] tests = new string[] { "0","1" };
+                       string[] tests = new string[] { "0","1","3","4", "5" };
 
                        foreach (string s in tests) {
                                win.LoadTest (s);
index 91c394e2aace66fa80135e82fd7b467f1c20d445..33ac22d85ce0d5a9a636fe9a444365f0c21061c4 100644 (file)
     <None Include="Interfaces\0.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
-    <None Include="ExpectedOutputs\0.png">
+    <None Include="Interfaces\1.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
-    <None Include="Interfaces\1.crow">
+    <None Include="Interfaces\2.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
-    <None Include="ExpectedOutputs\1.png">
+    <None Include="Interfaces\testButton.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
-    <None Include="Interfaces\2.crow">
+    <None Include="Interfaces\3.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
-    <None Include="Interfaces\testButton.crow">
+    <None Include="Interfaces\4.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="Interfaces\5.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="ExpectedOutputs\0.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="ExpectedOutputs\1.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="ExpectedOutputs\3.png">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
-    <None Include="Interfaces\testImage.crow">
+    <None Include="ExpectedOutputs\4.png">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
-    <None Include="Interfaces\testStacks.crow">
+    <None Include="ExpectedOutputs\5.png">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
   </ItemGroup>