亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? configurationmappertest.cpp

?? This software aims to create an applet and panel tools to manage a wireless interface card, such as
?? CPP
字號:
//
// ConfigurationMapperTest.cpp
//
// $Id: //poco/Main/Util/testsuite/src/ConfigurationMapperTest.cpp#1 $
//
// Copyright (c) 2004-2005, Guenter Obiltschnig/Applied Informatics.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the distribution.
//
// 3. Redistributions in any form must be accompanied by information on
//    how to obtain complete source code for this software and any
//    accompanying software that uses this software.  The source code
//    must either be included in the distribution or be available for no
//    more than the cost of distribution plus a nominal fee, and must be
//    freely redistributable under reasonable conditions.  For an
//    executable file, complete source code means the source code for all
//    modules it contains.  It does not include source code for modules or
//    files that typically accompany the major components of the operating
//    system on which the executable file runs.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//


#include "ConfigurationMapperTest.h"
#include "CppUnit/TestCaller.h"
#include "CppUnit/TestSuite.h"
#include "Util/ConfigurationMapper.h"
#include "Util/MapConfiguration.h"
#include "Foundation/AutoPtr.h"
#include "Foundation/Exception.h"
#include <algorithm>


using Util::AbstractConfiguration;
using Util::ConfigurationMapper;
using Util::MapConfiguration;
using Foundation::AutoPtr;


ConfigurationMapperTest::ConfigurationMapperTest(const std::string& name): CppUnit::TestCase(name)
{
}


ConfigurationMapperTest::~ConfigurationMapperTest()
{
}


void ConfigurationMapperTest::testMapper1()
{
	AutoPtr<AbstractConfiguration> pConf = createConfiguration();
	AutoPtr<AbstractConfiguration> pMapper = new ConfigurationMapper("", "", pConf);
	assert (pMapper->hasProperty("config.value1"));
	assert (pMapper->hasProperty("config.value2"));

	AbstractConfiguration::Keys keys;
	pMapper->keys(keys);
	assert (keys.size() == 1);
	assert (std::find(keys.begin(), keys.end(), "config") != keys.end());

	pMapper->keys("config", keys);
	assert (keys.size() == 3);
	assert (std::find(keys.begin(), keys.end(), "value1") != keys.end());
	assert (std::find(keys.begin(), keys.end(), "value2") != keys.end());
	assert (std::find(keys.begin(), keys.end(), "sub") != keys.end());
	
	assert (pMapper->getString("config.value1") == "v1");
	assert (pMapper->getString("config.sub.value2") == "v4");
	
	pMapper->setString("config.value3", "v5");
	assert (pMapper->getString("config.value3") == "v5");
	assert (pConf->getString("config.value3") == "v5");
}


void ConfigurationMapperTest::testMapper2()
{
	AutoPtr<AbstractConfiguration> pConf = createConfiguration();
	AutoPtr<AbstractConfiguration> pMapper = new ConfigurationMapper("config", "root.conf", pConf);

	assert (pMapper->hasProperty("root.conf.value1"));
	assert (pMapper->hasProperty("root.conf.value2"));

	AbstractConfiguration::Keys keys;
	pMapper->keys(keys);
	assert (keys.size() == 1);
	assert (std::find(keys.begin(), keys.end(), "root") != keys.end());

	pMapper->keys("root", keys);
	assert (keys.size() == 1);
	assert (std::find(keys.begin(), keys.end(), "conf") != keys.end());

	pMapper->keys("root.conf", keys);
	assert (keys.size() == 3);
	assert (std::find(keys.begin(), keys.end(), "value1") != keys.end());
	assert (std::find(keys.begin(), keys.end(), "value2") != keys.end());
	assert (std::find(keys.begin(), keys.end(), "sub") != keys.end());

	assert (pMapper->getString("root.conf.value1") == "v1");
	assert (pMapper->getString("root.conf.sub.value2") == "v4");
	
	pMapper->setString("root.conf.value3", "v5");
	assert (pMapper->getString("root.conf.value3") == "v5");
	assert (pConf->getString("config.value3") == "v5");
}


void ConfigurationMapperTest::testMapper3()
{
	AutoPtr<AbstractConfiguration> pConf = createConfiguration();
	AutoPtr<AbstractConfiguration> pMapper = new ConfigurationMapper("", "root", pConf);

	assert (pMapper->hasProperty("root.config.value1"));
	assert (pMapper->hasProperty("root.config.value2"));

	AbstractConfiguration::Keys keys;
	pMapper->keys(keys);
	assert (keys.size() == 1);
	assert (std::find(keys.begin(), keys.end(), "root") != keys.end());

	pMapper->keys("root", keys);
	assert (keys.size() == 1);
	assert (std::find(keys.begin(), keys.end(), "config") != keys.end());

	pMapper->keys("root.config", keys);
	assert (keys.size() == 3);
	assert (std::find(keys.begin(), keys.end(), "value1") != keys.end());
	assert (std::find(keys.begin(), keys.end(), "value2") != keys.end());
	assert (std::find(keys.begin(), keys.end(), "sub") != keys.end());
	
	assert (pMapper->getString("root.config.value1") == "v1");
	assert (pMapper->getString("root.config.sub.value2") == "v4");
	
	pMapper->setString("root.config.value3", "v5");
	assert (pMapper->getString("root.config.value3") == "v5");
	assert (pConf->getString("config.value3") == "v5");
}


void ConfigurationMapperTest::testMapper4()
{
	AutoPtr<AbstractConfiguration> pConf = createConfiguration();
	AutoPtr<AbstractConfiguration> pMapper = new ConfigurationMapper("config", "", pConf);

	assert (pMapper->hasProperty("value1"));
	assert (pMapper->hasProperty("value2"));

	AbstractConfiguration::Keys keys;
	pMapper->keys(keys);
	assert (keys.size() == 3);
	assert (std::find(keys.begin(), keys.end(), "value1") != keys.end());
	assert (std::find(keys.begin(), keys.end(), "value2") != keys.end());
	assert (std::find(keys.begin(), keys.end(), "sub") != keys.end());
	
	assert (pMapper->getString("value1") == "v1");
	assert (pMapper->getString("sub.value2") == "v4");
	
	pMapper->setString("value3", "v5");
	assert (pMapper->getString("value3") == "v5");
	assert (pConf->getString("config.value3") == "v5");
}


AbstractConfiguration* ConfigurationMapperTest::createConfiguration() const
{
	AbstractConfiguration* pConfig = new MapConfiguration;
	
	pConfig->setString("config.value1", "v1");
	pConfig->setString("config.value2", "v2");
	pConfig->setString("config.sub.value1", "v3");
	pConfig->setString("config.sub.value2", "v4");
	
	return pConfig;
}


void ConfigurationMapperTest::setUp()
{
}


void ConfigurationMapperTest::tearDown()
{
}


CppUnit::Test* ConfigurationMapperTest::suite()
{
	CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ConfigurationMapperTest");

	CppUnit_addTest(pSuite, ConfigurationMapperTest, testMapper1);
	CppUnit_addTest(pSuite, ConfigurationMapperTest, testMapper2);
	CppUnit_addTest(pSuite, ConfigurationMapperTest, testMapper3);
	CppUnit_addTest(pSuite, ConfigurationMapperTest, testMapper4);

	return pSuite;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产女主播一区| 2023国产精品| 久久久久99精品国产片| 亚洲精品日韩一| 国产乱人伦偷精品视频免下载| 日本久久电影网| 亚洲国产经典视频| 久久国产精品99久久久久久老狼| 国产裸体歌舞团一区二区| 欧美日本在线播放| 亚洲线精品一区二区三区 | 色又黄又爽网站www久久| www国产成人| 久久国产免费看| 欧美一区二区三区免费大片| 亚洲精品视频在线观看网站| 不卡区在线中文字幕| 国产清纯白嫩初高生在线观看91| 韩国精品一区二区| 日韩欧美一级二级三级 | 亚洲女厕所小便bbb| 国产99久久久久久免费看农村| 欧美一区二区三区视频免费播放| 亚洲成人黄色小说| 欧美三级中文字幕在线观看| 亚洲美女精品一区| av不卡在线播放| 亚洲人吸女人奶水| 色老汉一区二区三区| 亚洲视频综合在线| 色婷婷精品久久二区二区蜜臂av| 亚洲视频一区在线观看| 97国产一区二区| 日韩美女精品在线| 91论坛在线播放| 一区二区三区成人在线视频| 91碰在线视频| 一区二区三区四区不卡在线| 一本到不卡免费一区二区| 亚洲综合免费观看高清完整版在线| 91麻豆123| 偷拍自拍另类欧美| 91精品国产黑色紧身裤美女| 美女性感视频久久| 精品国免费一区二区三区| 国产激情一区二区三区四区 | 高清在线不卡av| 国产精品午夜在线观看| 91浏览器在线视频| 五月激情六月综合| 26uuu另类欧美| av中文字幕在线不卡| 亚洲老司机在线| 在线电影国产精品| 国产高清在线精品| 亚洲一区视频在线| 日韩美女在线视频| 成人小视频免费在线观看| 一区二区三区四区中文字幕| 日韩欧美综合在线| 国产999精品久久| 一级女性全黄久久生活片免费| 欧美高清激情brazzers| 国产精品亚洲成人| 亚洲天天做日日做天天谢日日欢| 欧美日韩一级视频| 国产精品一线二线三线精华| 夜夜爽夜夜爽精品视频| 亚洲精品一区二区三区福利| 色综合视频在线观看| 日韩av一区二| 久久综合九色欧美综合狠狠| 粉嫩av一区二区三区| 亚洲综合激情另类小说区| 久久综合九色综合97婷婷| 欧美亚洲禁片免费| 国产成人一区在线| 午夜成人免费电影| 中文字幕一区二区三区在线播放| 欧美一级国产精品| 色综合久久久久久久| 国产一区在线精品| 午夜精品一区二区三区电影天堂| 国产日产亚洲精品系列| 欧美一区二区视频观看视频| 99r精品视频| 国产精品一线二线三线精华| 舔着乳尖日韩一区| 亚洲美女区一区| 国产精品免费视频一区| 精品国产一区二区三区不卡 | 蜜桃视频一区二区| 亚洲免费在线观看| 日本一区二区三区电影| 欧美一级xxx| 欧美人动与zoxxxx乱| 一本色道久久加勒比精品 | 国产精品伦理一区二区| 欧美成人国产一区二区| 欧美日韩国产首页| 日本韩国精品在线| 91社区在线播放| av电影在线观看完整版一区二区| 国产成人免费视频精品含羞草妖精| 男男gaygay亚洲| 日本成人在线看| 午夜精品久久久久久久久久| 一区二区三区中文字幕电影| 亚洲图片激情小说| 亚洲精品视频一区| 一区二区三区日本| 亚洲欧洲精品天堂一级| 中文一区二区在线观看| 国产欧美一区二区精品婷婷| 久久在线观看免费| 久久综合狠狠综合久久综合88| 精品日韩99亚洲| 久久综合狠狠综合久久综合88 | 2024国产精品| 国产色产综合产在线视频| 久久久综合精品| 欧美激情在线一区二区| 国产精品传媒视频| 亚洲欧洲综合另类| 午夜婷婷国产麻豆精品| 日韩高清在线观看| 麻豆精品在线视频| 国产成人午夜视频| 懂色av中文字幕一区二区三区| 成人久久18免费网站麻豆| 99精品一区二区| 欧美日韩国产另类一区| 欧美一区午夜视频在线观看| 欧美v日韩v国产v| 国产日产精品1区| 亚洲九九爱视频| 美国毛片一区二区| 国产精一品亚洲二区在线视频| 丰满放荡岳乱妇91ww| 一本色道久久综合亚洲91| 欧美人妖巨大在线| 国产日韩视频一区二区三区| 18欧美亚洲精品| 日韩国产一二三区| 国产成人亚洲精品青草天美| 91亚洲永久精品| 日韩小视频在线观看专区| 国产精品福利在线播放| 亚洲成人av电影在线| 国产成人鲁色资源国产91色综| 91日韩一区二区三区| 精品少妇一区二区三区免费观看| 国产蜜臀av在线一区二区三区| 亚洲黄色av一区| 国产一区在线看| 欧美日韩一区精品| 久久精品视频免费| 亚洲二区在线观看| 国产aⅴ精品一区二区三区色成熟| 欧洲国内综合视频| 国产欧美日韩一区二区三区在线观看| 一区二区三区中文字幕电影| 国产一区二区电影| 欧美日韩国产精品成人| 中文字幕欧美激情一区| 日韩一区欧美二区| 色噜噜狠狠色综合中国| 精品国产露脸精彩对白| 亚洲香蕉伊在人在线观| 99re这里只有精品首页| 欧美变态口味重另类| 午夜精品久久久久久久久久久| 成人免费视频播放| 26uuu亚洲| 三级欧美在线一区| 日本精品一级二级| 国产精品久久综合| 国产麻豆视频一区二区| 欧美一区二区三区系列电影| √…a在线天堂一区| 国产成人精品午夜视频免费| 91精选在线观看| 亚洲国产日产av| 色欧美日韩亚洲| 亚洲老司机在线| 91香蕉视频黄| 国产精品国产三级国产专播品爱网| 美女一区二区在线观看| 91麻豆精品国产91久久久使用方法 | 欧美午夜精品一区二区蜜桃| 国产精品卡一卡二卡三| 国产91丝袜在线播放九色| 精品对白一区国产伦| 美女尤物国产一区| 日韩欧美综合一区| 激情丁香综合五月| 久久亚洲捆绑美女| 国产精品中文欧美| 欧美国产国产综合| 成人免费毛片a|