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> 39 :
public CppUnit::TestFixture
97 const char * opt =
"a:bH::F:d";
100 while ((ii = go()) != -1) {
103 fprintf(stderr,
"ii : 0x%X.\n", ii);
108 char *
const vv[] = { (
char *)
"Hoge", (
char *)
"-a", (
char *)
"-b", (
char *)
"-c" };
109 const char * opt =
"abc";
116 CPPUNIT_ASSERT_EQUAL((
int)
'a', result);
117 CPPUNIT_ASSERT(!go.
optarg);
120 CPPUNIT_ASSERT_EQUAL((
int)
'b', result);
121 CPPUNIT_ASSERT(!go.
optarg);
124 CPPUNIT_ASSERT_EQUAL((
int)
'c', result);
125 CPPUNIT_ASSERT(!go.
optarg);
128 CPPUNIT_ASSERT_EQUAL(-1, result);
133 char *
const vv[] = { (
char *)
"Hoge", (
char *)
"-a", (
char *)
"-b", (
char *)
"-c" };
134 const char * opt =
"ac";
141 CPPUNIT_ASSERT_EQUAL((
int)
'a', result);
142 CPPUNIT_ASSERT(!go.
optarg);
146 CPPUNIT_ASSERT_EQUAL((
int)
'?', result);
147 CPPUNIT_ASSERT(!go.
optarg);
150 CPPUNIT_ASSERT_EQUAL((
int)
'c', result);
151 CPPUNIT_ASSERT(!go.
optarg);
154 CPPUNIT_ASSERT_EQUAL(-1, result);
159 char *
const vv[] = { (
char *)
"Hoge", (
char *)
"-a", (
char *)
"Huga", (
char *)
"-c" };
160 const char * opt =
"ac";
167 CPPUNIT_ASSERT_EQUAL((
int)
'a', result);
168 CPPUNIT_ASSERT(!go.
optarg);
171 CPPUNIT_ASSERT_EQUAL((
int)
'c', result);
172 CPPUNIT_ASSERT(!go.
optarg);
175 CPPUNIT_ASSERT_EQUAL(-1, result);
180 char *
const vv[] = { (
char *)
"Hoge", (
char *)
"-a", (
char *)
"-Foe", (
char *)
"-c" };
181 const char * opt =
"aF:c";
188 CPPUNIT_ASSERT_EQUAL((
int)
'a', result);
189 CPPUNIT_ASSERT(!go.
optarg);
192 CPPUNIT_ASSERT_EQUAL((
int)
'F', result);
193 CPPUNIT_ASSERT_EQUAL(
'o', go.
optarg[0]);
194 CPPUNIT_ASSERT_EQUAL(
'e', go.
optarg[1]);
195 CPPUNIT_ASSERT_EQUAL(
'\0', go.
optarg[2]);
198 CPPUNIT_ASSERT_EQUAL((
int)
'c', result);
199 CPPUNIT_ASSERT(!go.
optarg);
202 CPPUNIT_ASSERT_EQUAL(-1, result);
221 std::cout<<
"manager.os.name:"<<sysinfo.
sysname<<std::endl;
222 std::cout<<
"manager.os.release:"<<sysinfo.
release<<std::endl;
223 std::cout<<
"manager.os.version:"<<sysinfo.
version<<std::endl;
224 std::cout<<
"manager.os.arch:"<<sysinfo.
machine<<std::endl;
225 std::cout<<
"manager.os.hostname:"<<sysinfo.
nodename<<std::endl;
226 std::cout<<
"manager.pid:"<<pidc<<std::endl;
229 CPPUNIT_ASSERT(iret == 0 );
244 const char* config_file_env =
"PATH";
251 std::cout<<env<<std::endl;
253 CPPUNIT_ASSERT(env != NULL );
267 int main(
int argc,
char* argv[])
269 CppUnit::TextUi::TestRunner runner;
270 runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
271 CppUnit::Outputter* outputter =
272 new CppUnit::TextOutputter(&runner.result(), std::cout);
273 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]