From fac5744ca6e422eefe218a25f1a13ef8b3c73d0a Mon Sep 17 00:00:00 2001 From: N2614 Date: Wed, 27 Apr 2011 02:45:13 +0000 Subject: [PATCH] =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E5=BF=98=E3=82=8C?= 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@229 385bec56-5757-e545-9c3a-d8741f4650f1 --- .../tests/ConsoleBackup/Exporter/OMakefile | 1 + .../ConsoleBackup/Exporter/test_Exporter.cpp | 107 ++++++++++++++++++ .../sources/tests/ConsoleBackup/OMakefile | 20 ++++ 3 files changed, 128 insertions(+) create mode 100644 trunk/ConsoleDataMigration/sources/tests/ConsoleBackup/Exporter/test_Exporter.cpp create mode 100644 trunk/ConsoleDataMigration/sources/tests/ConsoleBackup/OMakefile diff --git a/trunk/ConsoleDataMigration/sources/tests/ConsoleBackup/Exporter/OMakefile b/trunk/ConsoleDataMigration/sources/tests/ConsoleBackup/Exporter/OMakefile index ffa784f..ef5f9f7 100644 --- a/trunk/ConsoleDataMigration/sources/tests/ConsoleBackup/Exporter/OMakefile +++ b/trunk/ConsoleDataMigration/sources/tests/ConsoleBackup/Exporter/OMakefile @@ -50,6 +50,7 @@ LIBS += libnn_test \ libnn_mcu \ libnn_ps \ libnn_am \ + lib_demo \ ROM_SPEC_FILE = ../../../ConsoleBackup/ConsoleBackup.rsf diff --git a/trunk/ConsoleDataMigration/sources/tests/ConsoleBackup/Exporter/test_Exporter.cpp b/trunk/ConsoleDataMigration/sources/tests/ConsoleBackup/Exporter/test_Exporter.cpp new file mode 100644 index 0000000..2c2aa79 --- /dev/null +++ b/trunk/ConsoleDataMigration/sources/tests/ConsoleBackup/Exporter/test_Exporter.cpp @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------* + Project: Horizon + File: test_Util.cpp + + Copyright 2009 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$ + *---------------------------------------------------------------------------*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "demo.h" + +#include "CommonLogger.h" +#include "HeapManager.h" +#include "Exporter.h" + +using namespace nn::test; + +class ExporterTest : public Suite { +public: + virtual bool InitializeSuite(); + virtual void FinalizeSuite(); + + ExporterTest() { + SUITE_NAME("TestUtil"); + TEST_ADD(ExporterTest::WriteTwlTitleData); + } +private: + void WriteTwlTitleData(); +}; + +namespace +{ + +const size_t s_GxHeapSize = 0x800000; + +} + +//------------------------------------------------------------------ +// Initialize/Finalize +//------------------------------------------------------------------ + +bool ExporterTest::InitializeSuite() +{ + // os の初期化 + nn::os::Initialize(); + + nn::fs::Initialize(); + + // amの初期化 + nn::am::InitializeForSystemMenu(); + + // ヒープの確保 + common::HeapManager::GetHeap()->Initialize(nn::os::GetDeviceMemoryAddress(), nn::os::GetDeviceMemorySize(), nn::os::ALLOCATE_OPTION_LINEAR); + + // RenderSystem の準備 + uptr heapForGx = reinterpret_cast(common::HeapManager::GetHeap()->Allocate(s_GxHeapSize)); + demo::RenderSystemDrawing renderSystem; + renderSystem.Initialize(heapForGx, s_GxHeapSize); + + // ログ描画の初期化 + common::Logger::GetLoggerInstance()->Initialize(common::CONSOLE_WIDTH, common::CONSOLE_HEIGHT, + common::CONSOLE_MAX_LINE, &renderSystem); + + return true; + +} + +void ExporterTest::FinalizeSuite() +{ +} + +//------------------------------------------------------------------ +// Test Util +//------------------------------------------------------------------ + + +//------------------------------------------------------------------ +// Test Functions +//------------------------------------------------------------------ + +void ExporterTest::WriteTwlTitleData() +{ + NN_LOG("WriteTwlTitleData\n"); + ConsoleBackup::ExportTwlTitleList(); +} + + +NN_TEST_DEFINE_MAIN(ExporterTest) + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/trunk/ConsoleDataMigration/sources/tests/ConsoleBackup/OMakefile b/trunk/ConsoleDataMigration/sources/tests/ConsoleBackup/OMakefile new file mode 100644 index 0000000..0b7f26b --- /dev/null +++ b/trunk/ConsoleDataMigration/sources/tests/ConsoleBackup/OMakefile @@ -0,0 +1,20 @@ +#!/usr/bin/env omake +#---------------------------------------------------------------------------- +# Project: Horizon +# File: OMakefile +# +# Copyright (C)2009 Nintendo Co., Ltd. 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$ +#---------------------------------------------------------------------------- + +if $(IsTestBuild) + .SUBDIRS: Exporter + +DefineDefaultRules()