本文整理汇总了C++中RUN函数的典型用法代码示例。如果您正苦于以下问题:C++ RUN函数的具体用法?C++ RUN怎么用?C++ RUN使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RUN函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: intersys_query_fetch
VALUE intersys_query_fetch(VALUE self) {
struct rbQuery* query;
VALUE data = Qnil;
Data_Get_Struct(self, struct rbQuery, query);
int num_cols = 0;
int i = 0;
int sql_code;
RUN(cbind_query_fetch(query->query, &sql_code));
data = rb_ary_new();
if(sql_code == 100) {
query->query = 1;
rb_funcall(self, rb_intern("close"), 0);
return data;
}
if(sql_code) {
return data;
// rb_raise(rb_eStandardError, "Error in SQL: %d", sql_code);
}
RUN(cbind_query_get_num_cols(query->query, &num_cols));
for(i = 0; i < num_cols; i++) {
rb_ary_push(data, rb_funcall(self, rb_intern("get_data"), 1, INT2FIX(i+1)));
}
return data;
}
示例2: main
int main() {
RUN(example1);
RUN(example2);
#if WITH_THREADS
RUN(example3);
#endif
}
示例3: RUN
char *test_State_http()
{
State state;
// Simulates doing a basic HTTP request then closing the connection.
RUN(http_dir,
OPEN,
REQ_RECV, HTTP_REQ, DIRECTORY, RESP_SENT, CLOSE);
// Simulates two keep-alive handler requests then a close.
RUN(http_handler,
OPEN,
REQ_RECV, HTTP_REQ, HANDLER, REQ_SENT,
REQ_RECV, HTTP_REQ, HANDLER, REQ_SENT, CLOSE);
// Simulates two requests over a proxy connection followed by
// the remote closing the connection so we have to shutdown.
RUN(http_proxy,
OPEN,
REQ_RECV, HTTP_REQ, PROXY, CONNECT,
REQ_SENT, REQ_RECV, HTTP_REQ, REQ_SENT, REQ_RECV, REMOTE_CLOSE,
CLOSE);
// Simulates a proxy connect that needs to exit after a
// handler request was issued and there's a bit of data left.
RUN(http_proxy_handler,
OPEN,
REQ_RECV, HTTP_REQ, PROXY, CONNECT,
REQ_SENT, REQ_RECV,
HANDLER, REQ_SENT, CLOSE);
return NULL;
}
示例4: do_test
static int
do_test (void)
{
int result = 0;
int e;
#define RUN(test) \
errno = 0; \
e = test; \
if (e != -1) \
{ \
printf ("%s returned %d\n", #test, e); \
result = 1; \
} \
else if (errno != EINVAL) \
{ \
printf ("%s didn't set errno to EINVAL (%s instead)\n", \
#test, strerror (errno)); \
result = 1; \
}
RUN (sighold (-1));
RUN (sighold (_NSIG + 100));
RUN (sigrelse (-1));
RUN (sigrelse (_NSIG + 100));
return result;
}
示例5: GetCurrentDirectory
void git::Create(LPCTSTR szOutputFile, LPCTSTR szWorkingDir, LPCTSTR szTime, LPCTSTR szUser, LPCTSTR szEmail, LPCTSTR szComment)
{
CString sOriginalDir;
GetCurrentDirectory(2000, sOriginalDir.GetBufferSetLength(2000));
SetCurrentDirectory(szWorkingDir);
if (!file::DoesFileExist(".git"))
{
CString sOutputFile = szOutputFile;
sOutputFile.Replace("../", "../../"); //workaround
CString sCommand;
sCommand.Format("git init >> %s", sOutputFile);
RUN(sCommand);
sCommand.Format("ECHO. >> %s", sOutputFile);
RUN(sCommand);
sCommand.Format("ECHO. >> %s", sOutputFile);
RUN(sCommand);
git::Commit(szOutputFile, szWorkingDir, szTime, szUser, szEmail, szComment);
}
SetCurrentDirectory(sOriginalDir);
}
示例6: RUN
void ActivationFunctionsTestCase::run()
{
RUN(ActivationFunctionsTestCase, softmax);
RUN(ActivationFunctionsTestCase, logistic);
RUN(ActivationFunctionsTestCase, normaltanh);
RUN(ActivationFunctionsTestCase, linear);
RUN(ActivationFunctionsTestCase, rectifier);
}
示例7: main
int main(int argc, char** argv) {
tl_init();
RUN(num_new);
RUN(build_and_print);
RUN(basic);
RUN(mul);
RUN(pow);
}
示例8: main
int main (int argc, char * argv[]){
printf ("Basics Testcase\n");
RUN (StructureParser::test_matchTypeName());
RUN (StructureParser::test_matchCppType());
RUN (StructureParser::test_matchVariableDefinition());
RUN (StructureParser::test_matchFunctionDeclaration());
return 0;
}
示例9: intersys_query_column_name
VALUE intersys_query_column_name(VALUE self, VALUE i) {
struct rbQuery* query;
Data_Get_Struct(self, struct rbQuery, query);
int len;
const wchar_t *res;
RUN(cbind_query_get_col_name_len(query->query, FIX2INT(i), &len));
RUN(cbind_query_get_col_name(query->query, FIX2INT(i), &res));
return FROMWCSTR(res);
}
示例10: main
int main(int argc, char ** argv) {
RUN(test_basic_diffusion);
RUN(test_near_borders);
RUN(test_border_temperatures);
RUN(test_on_border_edge_case);
return TEST_REPORT();
}
示例11: run_perftest
int run_perftest(maincontext_t* maincontext)
{
(void) maincontext;
RUN(perftest_task_syncrunner);
RUN(perftest_task_syncrunner_raw);
return 0;
}
示例12: intersys_query_execute
VALUE intersys_query_execute(VALUE self) {
struct rbQuery* query;
int sql_code;
int res;
Data_Get_Struct(self, struct rbQuery, query);
RUN(cbind_query_execute(query->query, &sql_code));
RUN(cbind_query_get_num_pars(query->query, &res));
query->executed = 1;
return self;
}
示例13: main
int main(void)
{
RUN(fix16_exp_unittests);
RUN(fix16_macros_unittests);
RUN(fix16_str_unittests);
RUN(fix16_unittests);
puts("SUCCESS");
return 0;
}
示例14: main
int
main (void) {
RUN(value);
RUN(var);
RUN(lexer);
ok_done();
return 0;
}
示例15: intersys_query_initialize
VALUE intersys_query_initialize(VALUE self, VALUE database, VALUE sql_query) {
struct rbQuery* query;
struct rbDatabase* base;
int sql_code;
Data_Get_Struct(self, struct rbQuery, query);
Data_Get_Struct(database, struct rbDatabase, base);
rb_iv_set(self, "@database", database);
query->limit = -1;
RUN(cbind_alloc_query(base->database, &query->query));
RUN(cbind_prepare_gen_query(query->query, WCHARSTR(TOWCHAR(sql_query)), &sql_code));
return self;
}