本文整理汇总了C++中TestApplication类的典型用法代码示例。如果您正苦于以下问题:C++ TestApplication类的具体用法?C++ TestApplication怎么用?C++ TestApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestApplication类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UtcDaliImageActorUseImageAlpha04
int UtcDaliImageActorUseImageAlpha04(void)
{
TestApplication application;
tet_infoline("Testing Dali::RenderableActor::SetUseImageAlpha()");
FrameBufferImage image = FrameBufferImage::New( 100, 50, Pixel::RGBA8888 );
RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
task.SetTargetFrameBuffer( image ); // To ensure frame buffer is connected
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
application.SendNotification();
application.Render(0);
ImageActor actor = ImageActor::New( image );
application.SendNotification();
application.Render(0);
actor.SetBlendMode( BlendingMode::ON );
actor.SetColor(Vector4(1.0, 1.0, 1.0, 1.0));
actor.SetSize(100, 50);
application.GetGlAbstraction().EnableCullFaceCallTrace(true); // For Enable(GL_BLEND)
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render();
const TraceCallStack& callTrace = application.GetGlAbstraction().GetCullFaceTrace();
DALI_TEST_EQUALS( BlendDisabled( callTrace ), false, TEST_LOCATION );
DALI_TEST_EQUALS( BlendEnabled( callTrace), true, TEST_LOCATION );
END_TEST;
}
示例2: UtcDaliImageFactoryReload03
// Test for reloading changed image
int UtcDaliImageFactoryReload03(void)
{
TestApplication application;
tet_infoline( "UtcDaliImageFactoryReload03 - Reload changed image" );
ImageFactory& imageFactory = Internal::ThreadLocalStorage::Get().GetImageFactory();
Vector2 testSize( 80.0f, 80.0f );
application.GetPlatform().SetClosestImageSize( testSize );
RequestPtr req = imageFactory.RegisterRequest( gTestImageFilename, NULL );
ResourceTicketPtr ticket = imageFactory.Load( *req.Get() );
application.SendNotification();
application.Render();
// emulate load success
EmulateImageLoaded( application, 80, 80 );
Vector2 newSize( 192.0f, 192.0f );
application.GetPlatform().SetClosestImageSize( newSize );
// Image file changed size, new resource request should be issued
ResourceTicketPtr ticket2 = imageFactory.Reload( *req.Get() );
DALI_TEST_CHECK( ticket != ticket2 );
ResourceTicketPtr ticket3 = imageFactory.Reload( *req.Get() );
DALI_TEST_EQUALS( ticket2, ticket3, TEST_LOCATION );
END_TEST;
}
示例3: UtcDaliHoverActorBecomesInsensitive
int UtcDaliHoverActorBecomesInsensitive(void)
{
TestApplication application;
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
Stage::GetCurrent().Add(actor);
// Render and notify
application.SendNotification();
application.Render();
// Connect to actor's hovered signal
SignalData data;
HoverEventFunctor functor( data );
actor.HoveredSignal().Connect( &application, functor );
// Emit a started signal
application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Started, data.hoverEvent.points[0].state, TEST_LOCATION );
data.Reset();
// Change actor to insensitive
actor.SetSensitive( false );
// Emit a motion signal, signalled with an interrupted
application.ProcessEvent( GenerateSingleHover( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Interrupted, data.hoverEvent.points[0].state, TEST_LOCATION );
data.Reset();
END_TEST;
}
示例4: UtcDaliDynamicsBodyConfigShapeConservation
int UtcDaliDynamicsBodyConfigShapeConservation(void)
{
tet_infoline("UtcDaliDynamicsBodyConfigShapeConservation");
TestApplication application;
// start up
application.SendNotification();
application.Render();
application.Render();
DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
if( !world )
{
// cannot create dynamics world, log failure and exit
DALI_TEST_CHECK( false );
END_TEST;
}
DynamicsBodyConfig config(DynamicsBodyConfig::New());
const float conservation = config.GetShapeConservation() + 0.1f;
config.SetShapeConservation(conservation);
DALI_TEST_EQUALS( conservation, config.GetShapeConservation(), Math::MACHINE_EPSILON_1, TEST_LOCATION );
END_TEST;
}
示例5: WinMain
// 엔트리 포인트에서의 TestApplication 실행
int WINAPI WinMain(HINSTANCE hI, HINSTANCE hPI, LPSTR cmdline, int iWinMode)
{
TestApplication application;
application.Run(hI, L"STL profiling", L"", true, eSWP_All, CW_USEDEFAULT, CW_USEDEFAULT, 300, 100, false, false, NULL);
return 0;
}
示例6: UtcDaliDynamicsBodyConfigConstructor
int UtcDaliDynamicsBodyConfigConstructor(void)
{
tet_infoline("UtcDaliDynamicsBodyConfigConstructor - DynamicsBodyConfig::DynamicsBodyConfig()");
TestApplication application;
// start up
application.SendNotification();
application.Render();
application.Render();
// Default constructor - create an uninitialized handle
DynamicsBodyConfig config;
DALI_TEST_CHECK( !config );
DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
if( !world )
{
// cannot create dynamics world, log failure and exit
DALI_TEST_CHECK( false );
END_TEST;
}
// initialize handle
config = DynamicsBodyConfig::New();
DALI_TEST_CHECK( config );
END_TEST;
}
示例7: UtcDaliHoverSystemOverlayActor
int UtcDaliHoverSystemOverlayActor(void)
{
TestApplication application;
Dali::Integration::Core& core( application.GetCore() );
Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
systemOverlay.GetOverlayRenderTasks().CreateTask();
// Create an actor and add it to the system overlay.
Actor systemActor = Actor::New();
systemActor.SetSize(100.0f, 100.0f);
systemActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
systemOverlay.Add( systemActor );
// Create an actor and add it to the stage as per normal, same position and size as systemActor
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
Stage::GetCurrent().Add(actor);
// Connect to the hover signals.
SignalData data;
HoverEventFunctor functor( data );
systemActor.HoveredSignal().Connect( &application, functor );
actor.HoveredSignal().Connect( &application, functor );
// Render and notify
application.SendNotification();
application.Render();
// Emit a started signal, the system overlay is drawn last so is at the top, should hit the systemActor.
application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( systemActor == data.hoveredActor );
END_TEST;
}
示例8: UtcDaliDynamicsBodyConfigCollisionMask
int UtcDaliDynamicsBodyConfigCollisionMask(void)
{
TestApplication application;
// start up
application.SendNotification();
application.Render();
application.Render();
const short int testMask = 0x7ffe;
DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
if( !world )
{
// cannot create dynamics world, log failure and exit
DALI_TEST_CHECK( false );
END_TEST;
}
DynamicsBodyConfig config(DynamicsBodyConfig::New());
config.SetCollisionMask(testMask);
tet_infoline("UtcDaliDynamicsBodyConfigCollisionMask- DynamicsBodyConfig::GetCollisionMask");
DALI_TEST_EQUALS( testMask, config.GetCollisionMask(), TEST_LOCATION );
tet_infoline("UtcDaliDynamicsBodyConfigCollisionMask - DynamicsBodyConfig::SetCollisionMask");
const short int mask = config.GetCollisionMask() + 1;
config.SetCollisionMask(mask);
DALI_TEST_EQUALS( mask, config.GetCollisionMask(), TEST_LOCATION );
END_TEST;
}
示例9: UtcDaliDynamicsBodyConfigAnchorHardness
int UtcDaliDynamicsBodyConfigAnchorHardness(void)
{
TestApplication application;
// start up
application.SendNotification();
application.Render();
application.Render();
const float testHardness = 0.87f;
DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
if( !world )
{
// cannot create dynamics world, log failure and exit
DALI_TEST_CHECK( false );
END_TEST;
}
DynamicsBodyConfig config(DynamicsBodyConfig::New());
config.SetAnchorHardness(testHardness);
tet_infoline("UtcDaliDynamicsBodyConfigAnchorHardness - DynamicsBodyConfig::GetAnchorHardness");
DALI_TEST_EQUALS( testHardness, config.GetAnchorHardness(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
tet_infoline("UtcDaliDynamicsBodyConfigAnchorHardness - DynamicsBodyConfig::SetAnchorHardness");
const float hardness = config.GetAnchorHardness() + 0.1f;
config.SetAnchorHardness(hardness);
DALI_TEST_EQUALS( hardness, config.GetAnchorHardness(), Math::MACHINE_EPSILON_1, TEST_LOCATION );
END_TEST;
}
示例10: UtcDaliDynamicsBodyConfigLinearDamping
int UtcDaliDynamicsBodyConfigLinearDamping(void)
{
TestApplication application;
// start up
application.SendNotification();
application.Render();
application.Render();
const float testDamping = 0.123f;
DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
if( !world )
{
// cannot create dynamics world, log failure and exit
DALI_TEST_CHECK( false );
END_TEST;
}
DynamicsBodyConfig config(DynamicsBodyConfig::New());
config.SetLinearDamping(testDamping);
tet_infoline("UtcDaliDynamicsBodyConfigLinearDamping- DynamicsBodyConfig::GetLinearDamping");
DALI_TEST_EQUALS( testDamping, config.GetLinearDamping(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
tet_infoline("UtcDaliDynamicsBodyConfigLinearDamping - DynamicsBodyConfig::SetLinearDamping");
const float damping = config.GetLinearDamping() + 0.1f;
config.SetLinearDamping(damping);
DALI_TEST_EQUALS( damping, config.GetLinearDamping(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
END_TEST;
}
示例11: UtcDaliDynamicsBodyConfigAngularSleepVelocity
int UtcDaliDynamicsBodyConfigAngularSleepVelocity(void)
{
TestApplication application;
// start up
application.SendNotification();
application.Render();
application.Render();
const float testSleepVelocity = 0.123f;
DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
if( !world )
{
// cannot create dynamics world, log failure and exit
DALI_TEST_CHECK( false );
END_TEST;
}
DynamicsBodyConfig config(DynamicsBodyConfig::New());
config.SetAngularSleepVelocity(testSleepVelocity);
tet_infoline("UtcDaliDynamicsBodyConfigAngularSleepVelocity - DynamicsBodyConfig::GetAngularSleepVelocity");
DALI_TEST_EQUALS( testSleepVelocity, config.GetAngularSleepVelocity(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
tet_infoline("UtcDaliDynamicsBodyConfigAngularSleepVelocity - DynamicsBodyConfig::SetAngularSleepVelocity");
const float sleepVelocity = config.GetAngularSleepVelocity() + 0.1f;
config.SetAngularSleepVelocity(sleepVelocity);
DALI_TEST_EQUALS( sleepVelocity, config.GetAngularSleepVelocity(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
END_TEST;
}
示例12: UtcDaliDynamicsBodyConfigNew
int UtcDaliDynamicsBodyConfigNew(void)
{
tet_infoline("UtcDaliDynamicsBodyConfigNew - DynamicsBodyConfig::New()");
TestApplication application;
// start up
application.SendNotification();
application.Render();
application.Render();
DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
if( !world )
{
// cannot create dynamics world, log failure and exit
DALI_TEST_CHECK( false );
END_TEST;
}
DynamicsBodyConfig config(DynamicsBodyConfig::New());
DALI_TEST_CHECK( config );
END_TEST;
}
示例13: UtcDaliDynamicsBodyConfigSetShape02
int UtcDaliDynamicsBodyConfigSetShape02(void)
{
tet_infoline("UtcDaliDynamicsBodyConfigSetShape02 - DynamicsBodyConfig::SetShape(DynamicsShape)");
TestApplication application;
// start up
application.SendNotification();
application.Render();
application.Render();
DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
if( !world )
{
// cannot create dynamics world, log failure and exit
DALI_TEST_CHECK( false );
END_TEST;
}
DynamicsBodyConfig config(DynamicsBodyConfig::New());
DALI_TEST_CHECK( DynamicsShape::CUBE == config.GetShape().GetType() );
const float radius(1.5f);
DynamicsShape shape(DynamicsShape::NewSphere(radius));
config.SetShape(shape);
DALI_TEST_CHECK( DynamicsShape::SPHERE == config.GetShape().GetType() );
END_TEST;
}
示例14: UtcDaliGestureDetectorDetachN03
int UtcDaliGestureDetectorDetachN03(void)
{
TestApplication application;
TestGestureManager& gestureManager = application.GetGestureManager();
// Use pan gesture as GestureDetector cannot be created.
GestureDetector detector = PanGestureDetector::New();
Actor actor = Actor::New();
detector.Attach(actor);
// Detach an actor twice - no exception should happen.
try
{
detector.Detach(actor);
DALI_TEST_EQUALS(true, gestureManager.WasCalled(TestGestureManager::UnregisterType), TEST_LOCATION);
gestureManager.Initialize(); // Reset values
detector.Detach(actor);
DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::UnregisterType), TEST_LOCATION);
}
catch (DaliException& e)
{
DALI_TEST_PRINT_ASSERT( e );
tet_result(TET_FAIL);
}
END_TEST;
}
示例15: UtcDaliDynamicsBodyConfigType
int UtcDaliDynamicsBodyConfigType(void)
{
TestApplication application;
// start up
application.SendNotification();
application.Render();
application.Render();
DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
if( !world )
{
// cannot create dynamics world, log failure and exit
DALI_TEST_CHECK( false );
END_TEST;
}
DynamicsBodyConfig config(DynamicsBodyConfig::New());
tet_infoline("UtcDaliDynamicsBodyConfigType - DynamicsBodyConfig::GetType");
DALI_TEST_CHECK( DynamicsBodyConfig::RIGID == config.GetType() );
tet_infoline("UtcDaliDynamicsBodyConfigType - DynamicsBodyConfig::SetType(const BodyType)");
config.SetType( DynamicsBodyConfig::SOFT );
DALI_TEST_CHECK( DynamicsBodyConfig::SOFT == config.GetType() );
END_TEST;
}