.upptst: SvoValue now tests Font, Painting, Drawing, Image

git-svn-id: svn://ultimatepp.org/upp/trunk@4949 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2012-05-14 14:46:32 +00:00
parent a3172b518a
commit ae1650154f
4 changed files with 42 additions and 3 deletions

View file

@ -56,8 +56,24 @@ GUI_APP_MAIN
uuid.d = 19999;
CheckType(uuid, true);
CheckType(Arial(50), true);
CheckType(Arial(50).Bold().Strikeout(), true);
{
DrawingDraw g(100, 100);
g.DrawText(0, 0, "Hello world");
Drawing x = g.GetResult();
CheckType(x);
}
{
PaintingPainter g(100, 100);
g.DrawText(0, 0, "Hello world");
Painting x = g.GetResult();
CheckType(x);
}
CheckType(CtrlImg::save());
v = ErrorValue("error");
CheckType(v, true);
ASSERT(v.IsVoid());
@ -103,4 +119,6 @@ GUI_APP_MAIN
RLOG("------------------------------");
RLOG("######## Everything is OK");
PromptOK("OK");
}

View file

@ -2,6 +2,7 @@
#define _SvoValue_SvoValue_h_
#include <CtrlLib/CtrlLib.h>
#include <Painter/Painter.h>
using namespace Upp;
@ -175,6 +176,23 @@ void CheckType(const T& x, bool checkhash = false)
LoadFromJson(ty, json);
RDUMP(ty);
ASSERT(IsNull(vv));
RDUMP(v);
tx = x;
xml = StoreAsXML(tx, "test");
RDUMP(xml);
ty = Null;
LoadFromXML(ty, xml);
RDUMP(ty);
ASSERT(StoreAsXML(tx, "X") == StoreAsXML(x, "X"));
json = StoreAsJson(tx);
RDUMP(json);
ty = Null;
LoadFromJson(ty, json);
RDUMP(ty);
ASSERT(StoreAsJson(tx) == StoreAsJson(x));
ASSERT(IsNull(vv));
}
}

View file

@ -4,7 +4,8 @@ optimize_speed;
uses
Core,
CtrlLib;
CtrlLib,
Painter;
file
SvoValue.h,
@ -14,5 +15,6 @@ file
SvoValue.cpp optimize_speed;
mainconfig
"" = "SSE2 SVO_VALUE GUI";
"" = "SSE2 SVO_VALUE GUI",
"" = "SSE2 OLD_VALUE GUI";

View file

@ -2,4 +2,5 @@
#define _SvoValue_icpp_init_stub
#include "Core/init"
#include "CtrlLib/init"
#include "Painter/init"
#endif