diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/SimpleXmlPreprocessor.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/SimpleXmlPreprocessor.cpp index cde1130..cf85e9d 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/SimpleXmlPreprocessor.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/SimpleXmlPreprocessor.cpp @@ -14,7 +14,11 @@ *---------------------------------------------------------------------------*/ #include "SimpleXmlPreprocessor.h" +#if defined(__ARMCC_VERSION) #include +#else +#include "test_common.h" +#endif namespace ConsoleRestore { diff --git a/trunk/ConsoleDataMigration/sources/tests/googletest/OMakefile b/trunk/ConsoleDataMigration/sources/tests/googletest/OMakefile index 20d2490..f770ddd 100644 --- a/trunk/ConsoleDataMigration/sources/tests/googletest/OMakefile +++ b/trunk/ConsoleDataMigration/sources/tests/googletest/OMakefile @@ -1 +1 @@ -.SUBDIRS: RegionIdModifier XmlCreator +.SUBDIRS: $(glob D, *) diff --git a/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/OMakefile b/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/OMakefile new file mode 100644 index 0000000..7c43f83 --- /dev/null +++ b/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/OMakefile @@ -0,0 +1,29 @@ +INCLUDES[] += + ./ + ../common + ../../../ConsoleRestore + +TARGET = testSimpleXmlPreprocessor +TEST_TARGET = SimpleXmlPreprocessor + +SRC_FILES[] = + testSimpleXmlPreprocessor + SimpleXmlPreprocessor + +# テスト独自のスタブを使用する場合に定義する +CXXFLAGS += -DPCTEST_USE_STUB + +# テストディレクトリ外にあるので独自ルールでビルド +$(TEST_TARGET)$(EXT_OBJ): ../../../ConsoleRestore/$(TEST_TARGET).cpp + $(CXX) $(CXXFLAGS) $(PREFIXED_INCLUDES) -c $< + +.DEFAULT: $(TEST_TARGET)$(EXT_OBJ) $(TARGET)$(EXE) + +CXXProgram($(TARGET), $(SRC_FILES)) + +.PHONY: clean test +clean: + rm -rf *$(EXT_OBJ) *$(EXE) + +test: $(TARGET)$(EXE) + $< diff --git a/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/stub.h b/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/stub.h new file mode 100644 index 0000000..7e2a85f --- /dev/null +++ b/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/stub.h @@ -0,0 +1,21 @@ +/*---------------------------------------------------------------------------* + Project: Horizon + File: stub.h + + Copyright 2009-2011 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Rev$ + *---------------------------------------------------------------------------*/ + +#ifndef STUB_H_ +#define STUB_H_ + +#define NN_LOG(...) (void)0 + +#endif /* STUB_H_ */ diff --git a/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/testSimpleXmlPreprocessor.cpp b/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/testSimpleXmlPreprocessor.cpp new file mode 100644 index 0000000..2247e67 --- /dev/null +++ b/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/testSimpleXmlPreprocessor.cpp @@ -0,0 +1,23 @@ +#include +#include + +#include "SimpleXmlPreprocessor.h" + +using namespace ConsoleRestore; + +namespace +{ + +const char testStr[] = "13269392255870117179924184EJA20305940JPN1324339327000000400000FEEB400,000400000FEEB000"; + +} + +TEST(testSimpleXmlPreprocessor, Canonicalize) +{ + SimpleXmlPreprocessor pp; + + std::string str(testStr); + pp.Canonicalize(str); + std::cout << str << std::endl; + +}