5823 view(s)
#ifndef NVUtil_cpp #define NVUtil_cpp
#include <cppunit/ui/text/TestRunner.h> #include <cppunit/TextOutputter.h> #include <cppunit/extensions/TestFactoryRegistry.h> #include <cppunit/extensions/HelperMacros.h> #include <cppunit/TestAssert.h>
#include <rtm/NVUtil.h>
namespace NVUtil {using namespace NVUtil; using namespace std;
int g_argc; vector<string> g_argv; /*! * @class NVUtilTests class * @brief NVUtil Test */ class NVUtilTests : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(NVUtilTests); CPPUNIT_TEST(test_newNV_Short); CPPUNIT_TEST(test_newNV_Long); CPPUNIT_TEST(test_newNV_Float); CPPUNIT_TEST(test_newNV_Double); CPPUNIT_TEST(test_newNV_Str); CPPUNIT_TEST(test_newNVChar); CPPUNIT_TEST(test_newNVBool); CPPUNIT_TEST(test_newNVOctet); CPPUNIT_TEST(test_copy); CPPUNIT_TEST(test_toProperties); CPPUNIT_TEST(test_copyToProperties); CPPUNIT_TEST(test_find); CPPUNIT_TEST(test_isString); CPPUNIT_TEST(test_toString); CPPUNIT_TEST(test_appendStringValue); CPPUNIT_TEST(test_append); CPPUNIT_TEST(test_dump); CPPUNIT_TEST(test_toStringNV); CPPUNIT_TEST_SUITE_END();
private:
public: public: NVUtilTests() { CORBA::ORB_var orb; char* argv[g_argc]; for (int i = 0; i < g_argc; i++) { argv[i] = (char *)g_argv[i].c_str(); } orb = CORBA::ORB_init(g_argc, argv); }
~NVUtilTests() { }
virtual void setUp() { } virtual void tearDown() { }
/*! * @brief newNV(char*,Value)<A4>離謄<B9><A5><C8> * * - CORBA::Short<B7><BF><A5>如<BC><A5><BF><A4><CE>NameValue<A4><F2><C0><B5>
*/ void test_newNV_Short() { // CORBA::Short<B7><BF><A4>離如<BC><A5><BF><A4><F2><BB><FD><A4><C4>NameVal<A4><F2><C0><B8><C0><AE><A4><B7><A1><A2><C3>佑<F2><C8><E6><B3>咾<B7><A4><C6><C0>
CORBA::Short value = 1; string name = "short"; SDOPackage::NameValue nv = newNV(name.c_str(), value); string nvName(nv.name); CPPUNIT_ASSERT_EQUAL(name, nvName);
CORBA::Short nvValue; nv.value >>= nvValue; CPPUNIT_ASSERT_EQUAL(value, nvValue); }
/*! * @brief newNV(char*,Value)<A4>離謄<B9><A5><C8> * * - CORBA::Long<B7><BF><A5>如<BC><A5><BF><A4><CE>NameValue<A4><F2><C0><B5>
*/ void test_newNV_Long() { // CORBA::Long<B7><BF><A4>離如<BC><A5><BF><A4><F2><BB><FD><A4><C4>NameValue
CORBA::Long value = 999999999; string name = "long"; SDOPackage::NameValue nv = newNV(name.c_str(), value); string nvName(nv.name);
ここまでunitテストの内容
コメント
テスト
テストテスト