From 5d687eb4be10db5f3421667a414e2f7833759b59 Mon Sep 17 00:00:00 2001 From: N2614 Date: Thu, 19 Jan 2012 02:30:31 +0000 Subject: [PATCH] =?UTF-8?q?SimpleXmlPreprocessor=E3=81=AE=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@573 385bec56-5757-e545-9c3a-d8741f4650f1 --- .../ConsoleRestore/SimpleXmlPreprocessor.cpp | 4 +++ .../sources/tests/googletest/OMakefile | 2 +- .../SimpleXmlPreprocessor/OMakefile | 29 +++++++++++++++++++ .../googletest/SimpleXmlPreprocessor/stub.h | 21 ++++++++++++++ .../testSimpleXmlPreprocessor.cpp | 23 +++++++++++++++ 5 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/OMakefile create mode 100644 trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/stub.h create mode 100644 trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/testSimpleXmlPreprocessor.cpp 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; + +}