/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
END_TEST;
}
-int UtcDaliBufferImageNewWithPolicy01(void)
-{
- TestApplication application;
-
- tet_infoline("UtcDaliBufferImageNewWithPolicy01 - BufferImage::New(unsigned int, unsigned int, Pixel::Format, LoadPolicy, ReleasePolicy)");
-
- // Force texture id's
- std::vector<GLuint> ids;
- ids.push_back( 23 );
- application.GetGlAbstraction().SetNextTextureIds( ids );
-
- // invoke default handle constructor
- BufferImage image;
-
- // initialise handle
- image = BufferImage::New(16, 16, Pixel::A8, Image::UNUSED);
- application.SendNotification();
- application.Render(16);
- application.Render(16);
- application.SendNotification();
-
- DALI_TEST_CHECK( image.GetWidth() == 16);
- Actor actor = CreateRenderableActor( image );
- Stage::GetCurrent().Add(actor);
-
- application.SendNotification();
- application.Render(16);
- // testing ReleasePolicy::Unused
- // fake loading image
- application.Render(16);
- application.SendNotification();
-
- DALI_TEST_CHECK ( !application.GetGlAbstraction().CheckTextureDeleted(23) );
-
- // discard texture when actor comes off stage
- Stage::GetCurrent().Remove(actor);
- application.Render(16);
- application.SendNotification();
- application.Render(16);
- application.SendNotification();
- DALI_TEST_CHECK ( application.GetGlAbstraction().CheckTextureDeleted(23) );
- END_TEST;
-}
-
-int UtcDaliBufferImageNewWithPolicy02(void)
-{
- TestApplication application;
-
- tet_infoline("UtcDaliBufferImageNewWithPolicy02 - BufferImage::New(PixelBuffer*, unsigned int, unsigned int, Pixel::Format, unsigned int, ReleasePolicy)");
-
- // Force texture id's
- std::vector<GLuint> ids;
- ids.push_back( 23 );
- application.GetGlAbstraction().SetNextTextureIds( ids );
-
- PixelBuffer* buffer = new PixelBuffer[16 * 16];
- BufferImage image = BufferImage::New(buffer, 16, 16, Pixel::A8, 16, Image::UNUSED);
- application.SendNotification();
- application.Render(16);
- application.Render(16);
- application.SendNotification();
-
- DALI_TEST_CHECK( image.GetWidth() == 16);
- Actor actor = CreateRenderableActor( image );
- Stage::GetCurrent().Add(actor);
-
- application.SendNotification();
- application.Render(16);
- // testing ReleasePolicy::Unused
- // fake loading image
- application.Render(16);
- application.SendNotification();
-
- DALI_TEST_CHECK ( !application.GetGlAbstraction().CheckTextureDeleted(23) );
-
- // discard texture when actor comes off stage
- Stage::GetCurrent().Remove(actor);
- application.Render(16);
- application.SendNotification();
- application.Render(16);
- application.SendNotification();
- DALI_TEST_CHECK ( application.GetGlAbstraction().CheckTextureDeleted(23) );
- END_TEST;
-}
-
int UtcDaliBufferImageDownCast(void)
{
TestApplication application;
application.SendNotification();
const TraceCallStack& callStack = application.GetGlAbstraction().GetTextureTrace();
- DALI_TEST_EQUALS( callStack.TestMethodAndParams(0, "TexSubImage2D", "0, 0, 16, 16"), true, TEST_LOCATION);
+
+ std::stringstream out;
+ out << GL_TEXTURE_2D <<", "<< 0u << ", " << 0u << ", " << 0u << ", " << 16u <<", "<< 16u;
+ DALI_TEST_EQUALS( callStack.TestMethodAndParams(0, "TexSubImage2D", out.str().c_str() ), true, TEST_LOCATION);
DALI_TEST_CHECK( SignalReceived == true );
SignalReceived = false;
application.SendNotification();
const TraceCallStack& callStack = application.GetGlAbstraction().GetTextureTrace();
- DALI_TEST_EQUALS( callStack.TestMethodAndParams(0, "TexSubImage2D", "9, 9, 5, 5"), true, TEST_LOCATION);
- DALI_TEST_EQUALS( callStack.TestMethodAndParams(1, "TexSubImage2D", "2, 2, 4, 4"), true, TEST_LOCATION);
- DALI_TEST_EQUALS( callStack.TestMethodAndParams(2, "TexSubImage2D", "3, 3, 1, 6"), true, TEST_LOCATION);
+
+ {
+ std::stringstream out;
+ out << GL_TEXTURE_2D <<", "<< 0u << ", " << 9u << ", " << 9u << ", " << 5u <<", "<< 5u;
+ DALI_TEST_EQUALS( callStack.TestMethodAndParams(0, "TexSubImage2D", out.str().c_str()), true, TEST_LOCATION);
+ }
+
+ {
+ std::stringstream out;
+ out << GL_TEXTURE_2D <<", "<< 0u << ", " << 2u << ", " << 2u << ", " << 4u <<", "<< 4u;
+ DALI_TEST_EQUALS( callStack.TestMethodAndParams(1, "TexSubImage2D", out.str().c_str()), true, TEST_LOCATION);
+ }
+
+ {
+ std::stringstream out;
+ out << GL_TEXTURE_2D <<", "<< 0u << ", " << 3u << ", " << 3u << ", " << 1u <<", "<< 6u;
+ DALI_TEST_EQUALS( callStack.TestMethodAndParams(2, "TexSubImage2D", out.str().c_str()), true, TEST_LOCATION);
+ }
DALI_TEST_CHECK( SignalReceived == true );
SignalReceived = false;