Fix crash
[ryzomcore.git] / nel / tools / nel_unit_test / ut_misc_variable.h
blob16b04190b71a66e38b4949483364880ef0e4b376
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef UT_MISC_VARIABLE
18 #define UT_MISC_VARIABLE
20 #include <nel/misc/variable.h>
22 class CUTMiscVariable : public Test::Suite
24 public:
25 CUTMiscVariable ()
27 TEST_ADD(CUTMiscVariable ::declareVar)
30 void declareVar()
33 NLMISC::CVariable<std::string> myLocalVar("test", "myLocalVar", "no help", "");
35 TEST_ASSERT(myLocalVar.get() == string(""));
36 TEST_ASSERT(NLMISC::CCommandRegistry::getInstance().execute("myLocalVar foo", (*NLMISC::InfoLog)));
37 TEST_ASSERT(myLocalVar.get() == string("foo"));
40 TEST_ASSERT(!NLMISC::CCommandRegistry::getInstance().execute("myLocalVar foo", (*NLMISC::InfoLog)));
44 #endif