• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TestApplication类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中TestApplication的典型用法代码示例。如果您正苦于以下问题:C++ TestApplication类的具体用法?C++ TestApplication怎么用?C++ TestApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TestApplication类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:32,代码来源:utc-Dali-ImageActor.cpp


示例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;
}
开发者ID:mettalla,项目名称:dali,代码行数:31,代码来源:utc-Dali-Internal-ImageFactory.cpp


示例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;
}
开发者ID:tizenorg,项目名称:platform.core.uifw.dali-core,代码行数:34,代码来源:utc-Dali-HoverProcessing.cpp


示例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;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:28,代码来源:utc-Dali-DynamicsBodyConfig.cpp


示例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;
}
开发者ID:jaeseock,项目名称:MiniKey,代码行数:8,代码来源:main.cpp


示例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;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:32,代码来源:utc-Dali-DynamicsBodyConfig.cpp


示例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;
}
开发者ID:tizenorg,项目名称:platform.core.uifw.dali-core,代码行数:35,代码来源:utc-Dali-HoverProcessing.cpp


示例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;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:33,代码来源:utc-Dali-DynamicsBodyConfig.cpp


示例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;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:33,代码来源:utc-Dali-DynamicsBodyConfig.cpp


示例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;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:33,代码来源:utc-Dali-DynamicsBodyConfig.cpp


示例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;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:33,代码来源:utc-Dali-DynamicsBodyConfig.cpp


示例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;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:26,代码来源:utc-Dali-DynamicsBodyConfig.cpp


示例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;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:32,代码来源:utc-Dali-DynamicsBodyConfig.cpp


示例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;
}
开发者ID:mettalla,项目名称:dali,代码行数:28,代码来源:utc-Dali-GestureDetector.cpp


示例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;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:29,代码来源:utc-Dali-DynamicsBodyConfig.cpp


示例16: UtcDaliStageSignalWheelEventP

int UtcDaliStageSignalWheelEventP(void)
{
  TestApplication application;
  Stage stage = Stage::GetCurrent();

  WheelEventSignalData data;
  WheelEventReceivedFunctor functor( data );
  stage.WheelEventSignal().Connect( &application, functor );

  Integration::WheelEvent event( Integration::WheelEvent::CUSTOM_WHEEL, 0, 0u, Vector2( 0.0f, 0.0f ), 1, 1000u );
  application.ProcessEvent( event );

  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
  DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event.type) == data.receivedWheelEvent.type );
  DALI_TEST_CHECK( event.direction == data.receivedWheelEvent.direction );
  DALI_TEST_CHECK( event.modifiers == data.receivedWheelEvent.modifiers );
  DALI_TEST_CHECK( event.point == data.receivedWheelEvent.point );
  DALI_TEST_CHECK( event.z == data.receivedWheelEvent.z );
  DALI_TEST_CHECK( event.timeStamp == data.receivedWheelEvent.timeStamp );

  data.Reset();

  Integration::WheelEvent event2( Integration::WheelEvent::CUSTOM_WHEEL, 0, 0u, Vector2( 0.0f, 0.0f ), -1, 1000u );
  application.ProcessEvent( event2 );

  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
  DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event2.type) == data.receivedWheelEvent.type );
  DALI_TEST_CHECK( event2.direction == data.receivedWheelEvent.direction );
  DALI_TEST_CHECK( event2.modifiers == data.receivedWheelEvent.modifiers );
  DALI_TEST_CHECK( event2.point == data.receivedWheelEvent.point );
  DALI_TEST_CHECK( event2.z == data.receivedWheelEvent.z );
  DALI_TEST_CHECK( event2.timeStamp == data.receivedWheelEvent.timeStamp );
  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:34,代码来源:utc-Dali-Stage.cpp


示例17: UtcDaliHoverMultipleRenderableActors

int UtcDaliHoverMultipleRenderableActors(void)
{
  TestApplication application;
  Stage stage ( Stage::GetCurrent() );
  Vector2 stageSize ( stage.GetSize() );

  Actor parent = CreateRenderableActor();
  parent.SetSize( 100.0f, 100.0f );
  parent.SetAnchorPoint(AnchorPoint::TOP_LEFT);
  stage.Add(parent);

  Actor actor = CreateRenderableActor();
  actor.SetSize( 100.0f, 100.0f );
  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
  parent.Add(actor);

  // Render and notify
  application.SendNotification();
  application.Render();

  // Connect to layer's hovered signal
  SignalData data;
  HoverEventFunctor functor( data );
  parent.HoveredSignal().Connect( &application, functor );
  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_CHECK( actor == data.hoveredActor );
  END_TEST;
}
开发者ID:tizenorg,项目名称:platform.core.uifw.dali-core,代码行数:32,代码来源:utc-Dali-HoverProcessing.cpp


示例18: UtcDaliTapGestureSignalReceptionMultipleDetectorsOnActor

int UtcDaliTapGestureSignalReceptionMultipleDetectorsOnActor(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();

  // Attach actor to one detector
  SignalData firstData;
  GestureReceivedFunctor firstFunctor(firstData);
  TapGestureDetector firstDetector = TapGestureDetector::New();
  firstDetector.Attach(actor);
  firstDetector.DetectedSignal().Connect(&application, firstFunctor);

  // Attach actor to another detector
  SignalData secondData;
  GestureReceivedFunctor secondFunctor(secondData);
  TapGestureDetector secondDetector = TapGestureDetector::New();
  secondDetector.Attach(actor);
  secondDetector.DetectedSignal().Connect(&application, secondFunctor);

  // Tap in actor's area - both detector's functors should be called
  application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
  application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
  DALI_TEST_EQUALS(true, firstData.functorCalled, TEST_LOCATION);
  DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
  END_TEST;
}
开发者ID:tizenorg,项目名称:platform.core.uifw.dali-core,代码行数:34,代码来源:utc-Dali-TapGestureDetector.cpp


示例19: UtcDaliTapGestureEmitIncorrectStateContinuing

int UtcDaliTapGestureEmitIncorrectStateContinuing(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();

  // Attach actor to detector
  SignalData data;
  GestureReceivedFunctor functor( data );
  TapGestureDetector detector = TapGestureDetector::New();
  detector.Attach(actor);
  detector.DetectedSignal().Connect( &application, functor );

  // Try a Continuing state
  try
  {
    application.ProcessEvent(GenerateTap(Gesture::Continuing, 1u, 1u, Vector2(50.0f, 10.0f)));
    tet_result(TET_FAIL);
  }
  catch ( Dali::DaliException& e )
  {
    DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
  }
  END_TEST;
}
开发者ID:tizenorg,项目名称:platform.core.uifw.dali-core,代码行数:32,代码来源:utc-Dali-TapGestureDetector.cpp


示例20: UtcDaliTapGestureSetTapsRequiredMinMaxCheck

int UtcDaliTapGestureSetTapsRequiredMinMaxCheck(void)
{
  TestApplication application;

  // Attach an actor and change the required touches

  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();

  // Set the minimum to be greater than the maximum, should Assert

  try
  {
    TapGestureDetector detector = TapGestureDetector::New();
    detector.SetMinimumTapsRequired( 7u );
    detector.SetMaximumTapsRequired( 3u );
    detector.Attach(actor);
    DALI_TEST_CHECK( false ); // Should not get here
  }
  catch ( DaliException& e )
  {
    DALI_TEST_CHECK( true );
  }

  END_TEST;
}
开发者ID:tizenorg,项目名称:platform.core.uifw.dali-core,代码行数:32,代码来源:utc-Dali-TapGestureDetector.cpp



注:本文中的TestApplication类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TestCase类代码示例发布时间:2022-05-31
下一篇:
C++ TestApp类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap