20 #include <cppunit/ui/text/TestRunner.h> 21 #include <cppunit/TextOutputter.h> 22 #include <cppunit/extensions/TestFactoryRegistry.h> 23 #include <cppunit/extensions/HelperMacros.h> 24 #include <cppunit/TestAssert.h> 43 :
public CppUnit::TestFixture
101 const char * opt =
"a:bH::F:d";
104 while ((ii = go()) != -1) {
107 fprintf(stderr,
"ii : 0x%X.\n", ii);
112 char *
const vv[] = { (
char *)
"Hoge", (
char *)
"-a", (
char *)
"-b", (
char *)
"-c" };
113 const char * opt =
"abc";
120 CPPUNIT_ASSERT_EQUAL((
int)
'a', result);
121 CPPUNIT_ASSERT(!go.
optarg);
124 CPPUNIT_ASSERT_EQUAL((
int)
'b', result);
125 CPPUNIT_ASSERT(!go.
optarg);
128 CPPUNIT_ASSERT_EQUAL((
int)
'c', result);
129 CPPUNIT_ASSERT(!go.
optarg);
132 CPPUNIT_ASSERT_EQUAL(-1, result);
137 char *
const vv[] = { (
char *)
"Hoge", (
char *)
"-a", (
char *)
"-b", (
char *)
"-c" };
138 const char * opt =
"ac";
145 CPPUNIT_ASSERT_EQUAL((
int)
'a', result);
146 CPPUNIT_ASSERT(!go.
optarg);
150 CPPUNIT_ASSERT_EQUAL((
int)
'?', result);
151 CPPUNIT_ASSERT(!go.
optarg);
154 CPPUNIT_ASSERT_EQUAL((
int)
'c', result);
155 CPPUNIT_ASSERT(!go.
optarg);
158 CPPUNIT_ASSERT_EQUAL(-1, result);
163 char *
const vv[] = { (
char *)
"Hoge", (
char *)
"-a", (
char *)
"Huga", (
char *)
"-c" };
164 const char * opt =
"ac";
171 CPPUNIT_ASSERT_EQUAL((
int)
'a', result);
172 CPPUNIT_ASSERT(!go.
optarg);
175 CPPUNIT_ASSERT_EQUAL((
int)
'c', result);
176 CPPUNIT_ASSERT(!go.
optarg);
179 CPPUNIT_ASSERT_EQUAL(-1, result);
184 char *
const vv[] = { (
char *)
"Hoge", (
char *)
"-a", (
char *)
"-Foe", (
char *)
"-c" };
185 const char * opt =
"aF:c";
192 CPPUNIT_ASSERT_EQUAL((
int)
'a', result);
193 CPPUNIT_ASSERT(!go.
optarg);
196 CPPUNIT_ASSERT_EQUAL((
int)
'F', result);
197 CPPUNIT_ASSERT_EQUAL(
'o', go.
optarg[0]);
198 CPPUNIT_ASSERT_EQUAL(
'e', go.
optarg[1]);
199 CPPUNIT_ASSERT_EQUAL(
'\0', go.
optarg[2]);
202 CPPUNIT_ASSERT_EQUAL((
int)
'c', result);
203 CPPUNIT_ASSERT(!go.
optarg);
206 CPPUNIT_ASSERT_EQUAL(-1, result);
225 std::cout<<
"manager.os.name:"<<sysinfo.
sysname<<std::endl;
226 std::cout<<
"manager.os.release:"<<sysinfo.
release<<std::endl;
227 std::cout<<
"manager.os.version:"<<sysinfo.
version<<std::endl;
228 std::cout<<
"manager.os.arch:"<<sysinfo.
machine<<std::endl;
229 std::cout<<
"manager.os.hostname:"<<sysinfo.
nodename<<std::endl;
230 std::cout<<
"manager.pid:"<<pidc<<std::endl;
233 CPPUNIT_ASSERT(iret == 0 );
248 const char* config_file_env =
"PATH";
255 std::cout<<env<<std::endl;
257 CPPUNIT_ASSERT(env != NULL );
271 int main(
int argc,
char* argv[])
273 CppUnit::TextUi::TestRunner runner;
274 runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
275 CppUnit::Outputter* outputter =
276 new CppUnit::TextOutputter(&runner.result(), std::cout);
277 runner.setOutputter(outputter);
char version[COIL_UTSNAME_LENGTH]
int main(int argc, char **argv)
void test_invalid_option()
virtual void tearDown()
Test finalization.
char sysname[COIL_UTSNAME_LENGTH]
CPPUNIT_TEST(test_simple_case)
char nodename[COIL_UTSNAME_LENGTH]
env
�͡��ॵ���С���� env = RtmEnv(sys.argv, ["localhost:2809"]) list0 = env.name_space["localhost:2809"].list_obj() env.name_space['localhost:2809'].rtc_handles.keys() ns = env.name_space['localhost:2809']
::pid_t pid_t
Get process ID of the caller process.
int uname(utsname *name)
Get System information.
char * getenv(const char *name)
Get environment variable.
CPPUNIT_TEST_SUITE(OSTests)
std::string sprintf(char const *__restrict fmt,...)
Convert it into a format given with an argumen.
CPPUNIT_TEST_SUITE_REGISTRATION(OS::OSTests)
virtual void setUp()
Test initialization.
char machine[COIL_UTSNAME_LENGTH]
char release[COIL_UTSNAME_LENGTH]