本文整理汇总了C++中Pipeline::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Pipeline::clear方法的具体用法?C++ Pipeline::clear怎么用?C++ Pipeline::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pipeline
的用法示例。
在下文中一共展示了Pipeline::clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: strlen
void
Simple_Command_Parse_Test::test_parse_numeric_arg_1 ()
{
Pipeline p;
size_t errorc = 0;
Simple_Command *c[] = { 0, 0 };
std::vector<Argument *> *va[] = { 0, 0 };
Argument *a[] = { 0, 0, 0 };
const char *pipelinev[] = {
"filter1 15 5 | filter2 0700",
"filter1 15 5 2>&1 | filter2 0700 &> filter2.out"
};
const char *pipelinevp = 0;
for (uint idx = 0; idx < 2; idx++)
{
try
{
pipelinevp = pipelinev[idx];
p._charc = strlen (pipelinevp);
p._startp = pipelinevp;
p._endp = pipelinevp + p._charc;
p.parse (pipelinevp);
c[0] = static_cast<Simple_Command *> (p._cmdv.at (0));
c[1] = static_cast<Simple_Command *> (p._cmdv.at (1));
va[0] = c[0]->arguments ();
va[1] = c[1]->arguments ();
ASSERT_IDX (va[0]->size() == 2);
ASSERT_IDX (va[1]->size() == 1);
a[0] = va[0]->at (0);
a[1] = va[0]->at (1);
a[2] = va[1]->at (0);
ASSERT_IDX (Util::strEqu ( a[0]->value(), "15"));
ASSERT_IDX (Util::strEqu ( a[1]->value(), "5"));
ASSERT_IDX (Util::strEqu ( a[2]->value(), "0700"));
p.clear ();
}
CATCH_ERROR_PCHAR;
}
ASSERT_NO_ERROR;
}
示例2: strlen
void
Pipeline_Parse_Test::test_parse_exit_logical_not ()
{
Pipeline p;
uint errorc = 0;
Simple_Command *f[] = { 0, 0, 0 };
const char *pipelinev[] = {
"!filter1 | filter2",
" ! filter1 | filter2"
};
const char *pipelinevp = 0;
for (uint idx = 0; idx < 2; idx++)
{
try
{
// p._charc = strlen (pipelinev[idx]);
// p.__parse (pipelinev[idx]);
pipelinevp = pipelinev[idx];
p._charc = strlen (pipelinevp);
p._startp = pipelinevp;
p._endp = pipelinevp + p._charc;
p.parse (pipelinevp);
// f[0] = p._filters.at (0);
f[0] = static_cast<Simple_Command *> (p._cmdv.at (0));
p._exit_status = EXIT_FAILURE;
CPPUNIT_ASSERT (p._exit_not == true);
CPPUNIT_ASSERT (p.exit_status () == EXIT_SUCCESS);
p._exit_status = 2;
CPPUNIT_ASSERT (p.exit_status () == EXIT_SUCCESS);
CPPUNIT_ASSERT (Util::strEqu (f[0]->_file, "filter1"));
p.clear ();
}
CATCH_ERROR_PCHAR;
}
CPPUNIT_ASSERT (errorc == 0);
}