//------------------------------------------------------------------------------
// Lamp : Open source game middleware
// Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//------------------------------------------------------------------------------

/** @file
 * 変換テクスチャマネージャのテスト実装
 * @author Junpee
 */

#include "System/stdafx.h"
#include "Translator/Texture/TranslationTextureManagerTest.h"
#include "Translator/Texture/TranslationTextureManager.h"

namespace LampForMaya{

//------------------------------------------------------------------------------
// テストスィートの取得
Test* TranslationTextureManagerTest::suite(){
	TestSuite* suite = new TestSuite("TranslationTextureManagerTest");
	suite->addTest(new TestCaller(TranslationTextureManagerTest, testCollectTexture));
	return suite;
}
//------------------------------------------------------------------------------
// テクスチャの収集テスト
void TranslationTextureManagerTest::testCollectTexture(){
/*
	MGlobal::executeCommand(
		"file -f -o \"TranslationTextureManagerTestCollectTexture.mb\"",
		true, true);
	TranslationTextureManager* textureManager_ =
		new TranslationTextureManager();
	textureManager_->collectTextures();
	TestEquals(2, textureManager_->getCount());
	TexCoord2 uv;
	// 一枚目テクスチャ
	TranslationTexture* texture0 = textureManager_->get(0);
	TestEquals("file1", texture0->getName());
	TestEquals(
		"D:/!Cur/Lamp/LampForMaya/Projects/MayaProject/textures/brick1.tga",
		texture0->getPicturePath());
	TestEquals("brick1", texture0->getPictureName());
	TestAssert(texture0->getMirrorU());
	TestAssert(!texture0->getMirrorV());
	TestAssert(!texture0->getWrapU());
	TestAssert(texture0->getWrapV());
	uv.set(1.f, 2.f);
	TestAssert(uv == texture0->getRepeatUV());
	uv.set(0.1f, 0.2f);
	TestAssert(uv == texture0->getOffsetUV());
	// 二枚目テクスチャ
	TranslationTexture* texture1 = textureManager_->get(1);
	TestEquals("file2", texture1->getName());
	TestEquals(
		"D:/!Cur/Lamp/LampForMaya/Projects/MayaProject/textures/brick2.tga",
		texture1->getPicturePath());
	TestEquals("brick2", texture1->getPictureName());
	TestAssert(!texture1->getMirrorU());
	TestAssert(texture1->getMirrorV());
	TestAssert(texture1->getWrapU());
	TestAssert(!texture1->getWrapV());
	uv.set(3.f, 4.f);
	TestAssert(uv == texture1->getRepeatUV());
	uv.set(0.3f, 0.4f);
	TestAssert(uv == texture1->getOffsetUV());

	textureManager_->clear();
	delete textureManager_;
*/
}
//------------------------------------------------------------------------------
} // End of namespace LampForMaya
//------------------------------------------------------------------------------
