本文整理汇总了C++中doTest函数的典型用法代码示例。如果您正苦于以下问题:C++ doTest函数的具体用法?C++ doTest怎么用?C++ doTest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了doTest函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int
main( int argc, char *argv[] )
{
bind_transmitter_resp_t a;
bind_transmitter_resp_t b;
tlv_t tlv;
memset(&a, 0, sizeof(bind_transmitter_resp_t));
memset(&b, 0, sizeof(bind_transmitter_resp_t));
memset(&tlv, 0, sizeof(tlv_t));
/* Init PDU ***********************************************************/
b.command_length = 0;
b.command_id = BIND_TRANSMITTER_RESP;
b.command_status = ESME_ROK;
b.sequence_number = 1;
snprintf( b.system_id, sizeof(b.system_id), "%s", "system_id");
tlv.tag = TLVID_sc_interface_version;
tlv.length = sizeof(uint8_t);
tlv.value.val16 = 0x34;
build_tlv( &(b.tlv), &tlv );
doTest(BIND_TRANSMITTER_RESP, &a, &b);
destroy_tlv( b.tlv );
destroy_tlv( a.tlv );
return( 0 );
};
示例2: main
int main(int argc, char** argv)
{
int messSize, compIters, innerIters, testIters, reportRank;
MPI_Init(&argc, &argv);
if ( argc != 4 )
{
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if ( rank == 0 )
printf("\n %s [# of comp iterations] [inner iterations] [total samples]\n\n", argv[0]);
MPI_Finalize();
exit(-1);
}
messSize = 4; /* number of doubles in Allreduce message */
reportRank = 0; /* Rank printing output */
compIters = atoi(argv[1]); /* Number of computation iterations */
innerIters = atoi(argv[2]); /* Number of inner loop iterations */
testIters = atoi(argv[3]); /* Number of total sample iterations */
doTest(messSize, reportRank, compIters, innerIters, testIters);
MPI_Finalize();
exit(0);
}
示例3: main
int
main( int argc, char *argv[] )
{
bind_transmitter_t a;
bind_transmitter_t b;
memset(&a, 0, sizeof(bind_transmitter_t));
memset(&b, 0, sizeof(bind_transmitter_t));
/* Init PDU ***********************************************************/
b.command_length = 0;
b.command_id = BIND_TRANSMITTER;
b.command_status = ESME_ROK;
b.sequence_number = 1;
snprintf( b.system_id, sizeof(b.system_id), "%s", "system_id");
snprintf( b.password, sizeof(b.password), "%s", "pass");
snprintf( b.system_type, sizeof(b.system_type), "%s", "syst");
b.interface_version = 0x34;
b.addr_ton = 2;
b.addr_npi = 1;
snprintf( b.address_range, sizeof(b.address_range), "%s", "address_range");
doTest(BIND_TRANSMITTER, &a, &b);
return( 0 );
};
示例4: genericOrderingTestWithResult
void genericOrderingTestWithResult(UCollator *coll, const char * const s[], uint32_t size, UCollationResult result) {
UChar t1[2048] = {0};
UChar t2[2048] = {0};
UCollationElements *iter;
UErrorCode status = U_ZERO_ERROR;
uint32_t i = 0, j = 0;
log_verbose("testing sequence:\n");
for(i = 0; i < size; i++) {
log_verbose("%s\n", s[i]);
}
iter = ucol_openElements(coll, t1, u_strlen(t1), &status);
if (U_FAILURE(status)) {
log_err("Creation of iterator failed\n");
}
for(i = 0; i < size-1; i++) {
for(j = i+1; j < size; j++) {
u_unescape(s[i], t1, 2048);
u_unescape(s[j], t2, 2048);
doTest(coll, t1, t2, result);
/* synwee : added collation element iterator test */
ucol_setText(iter, t1, u_strlen(t1), &status);
backAndForth(iter);
ucol_setText(iter, t2, u_strlen(t2), &status);
backAndForth(iter);
}
}
ucol_closeElements(iter);
}
示例5: UnicodeString
void TransliteratorAPITest::TestTransliterate3(){
UnicodeString rs="This is the replaceable String";
UnicodeString Data[] = {
"0", "0", "This is the replaceable String",
"2", "3", UnicodeString("Th\\u0069s is the replaceable String", ""),
"21", "23", UnicodeString("Th\\u0069s is the repl\\u0061\\u0063eable String", ""),
"14", "17", UnicodeString("Th\\u0069s is t\\u0068\\u0065\\u0020repl\\u0061\\u0063eable String", ""),
};
int start, limit;
UnicodeString message;
UParseError parseError;
UErrorCode status = U_ZERO_ERROR;
Transliterator *t=Transliterator::createInstance("Any-Hex", UTRANS_FORWARD, parseError, status);
if(U_FAILURE(status)) {
errln("Error creating transliterator %s", u_errorName(status));
delete t;
return;
}
if(t == 0)
errln("FAIL : construction");
for(uint32_t i=0; i<UPRV_LENGTHOF(Data); i=i+3){
start=getInt(Data[i+0]);
limit=getInt(Data[i+1]);
t->transliterate(rs, start, limit);
message=t->getID() + ".transliterate(ReplaceableString, start, limit):("+start+","+limit+"):";
doTest(message, rs, Data[i+2]);
}
delete t;
}
示例6: CC_SAFE_DELETE
void SpriteMainScene::doAutoTest()
{
isStating = false;
statCount = 0;
totalStatTime = 0.0f;
minFrameRate = -1.0f;
maxFrameRate = -1.0f;
// recreate a SubTest object
this->removeChild(_subTest->getTheParentNode());
CC_SAFE_DELETE(_subTest);
_subTest = new (std::nothrow) SubTest;
_subTest->initWithSubTest(_subtestNumber, this);
// create sprites & update the label
_quantityNodes = autoTestSpriteCounts[autoTestIndex];
for( int i = 0; i < _quantityNodes; i++)
{
auto sprite = _subTest->createSpriteWithTag(i);
doTest(sprite);
}
updateNodes();
updateTitle();
schedule(CC_SCHEDULE_SELECTOR(SpriteMainScene::beginStat), DELAY_TIME);
schedule(CC_SCHEDULE_SELECTOR(SpriteMainScene::endStat), DELAY_TIME + STAT_TIME);
}
示例7: TestExtra
static void TestExtra()
{
int32_t i, j;
int32_t len;
UCollator *myCollation;
UErrorCode status = U_ZERO_ERROR;
static const char str[]="& C < ch, cH, Ch, CH & Five, 5 & Four, 4 & one, 1 & Ampersand; '&' & Two, 2 ";
UChar rules[sizeof(str)];
len = strlen(str);
u_uastrcpy(rules, str);
myCollation=ucol_openRules(rules, len, UCOL_OFF, UCOL_DEFAULT_STRENGTH,NULL, &status);
if(U_FAILURE(status)){
log_err_status(status, "ERROR: in creation of rule based collator :%s\n", myErrorName(status));
return;
}
ucol_setStrength(myCollation, UCOL_TERTIARY);
for (i = 0; i < COUNT_TEST_CASES-1 ; i++)
{
for (j = i + 1; j < COUNT_TEST_CASES; j += 1)
{
doTest(myCollation, testCases[i], testCases[j], UCOL_LESS);
}
}
ucol_close(myCollation);
myCollation = 0;
}
示例8: errln
void CollationFrenchTest::TestSecondary(/* char* par */)
{
//test acute and grave ordering
int32_t i = 0;
int32_t j;
Collator::EComparisonResult expected;
UErrorCode status = U_ZERO_ERROR;
//myCollation->setAttribute(UCOL_FRENCH_COLLATION, UCOL_ON, status);
myCollation->setStrength(Collator::SECONDARY);
if (U_FAILURE(status))
errln("Error setting attribute in French collator");
else
{
const int32_t testAcuteSize = UPRV_LENGTHOF(testAcute);
for (i = 0; i < testAcuteSize; i++)
{
for (j = 0; j < testAcuteSize; j++)
{
if (i < j)
expected = Collator::LESS;
else if (i == j)
expected = Collator::EQUAL;
else // (i > j)
expected = Collator::GREATER;
doTest(myCollation, testAcute[i], testAcute[j], expected );
}
}
}
}
示例9: main
int main(int argc, const char **argv) {
SescConf = new SConfig(argc, argv);
GProcessor gproc;
//lsq = new LSQFull(&gproc,0);
lsq = new LSQFull(0);I(0);
timeval startTime;
gettimeofday(&startTime,0);
doTest();
timeval endTime;
gettimeofday(&endTime,0);
double msecs = ( endTime.tv_sec - startTime.tv_sec ) * 1000
+ ( endTime.tv_usec - startTime.tv_usec ) / 1000;
long double res = instTotal/1000;
res /= msecs;
MSG("------------------");
MSG ( "LSQ MIPS = %g secs = %g insts = %lld", (double) res, msecs/1000,(long long) instTotal );
MSG("------------------");
return 0;
}
示例10: TestPrimary
static void TestPrimary( )
{
int32_t len,i;
UCollator *myCollation;
UErrorCode status=U_ZERO_ERROR;
static const char str[]="& C < ch, cH, Ch, CH & Five, 5 & Four, 4 & one, 1 & Ampersand; '&' & Two, 2 ";
UChar rules[sizeof(str)];
len = strlen(str);
u_uastrcpy(rules, str);
myCollation=ucol_openRules(rules, len, UCOL_OFF, UCOL_DEFAULT_STRENGTH,NULL, &status);
if(U_FAILURE(status)){
log_err_status(status, "ERROR: in creation of rule based collator :%s\n", myErrorName(status));
return;
}
ucol_setStrength(myCollation, UCOL_PRIMARY);
for (i = 17; i < 26 ; i++)
{
doTest(myCollation, testSourceCases[i], testTargetCases[i], results[i]);
}
ucol_close(myCollation);
myCollation = 0;
}
示例11: TestSecondary
static void TestSecondary()
{
int32_t i,j, testAcuteSize;
UCollationResult expected=UCOL_EQUAL;
UErrorCode status = U_ZERO_ERROR;
myCollation = ucol_open("fr_FR", &status);
if(U_FAILURE(status)){
log_err_status(status, "ERROR: in creation of rule based collator: %s\n", myErrorName(status));
return;
}
ucol_setAttribute(myCollation, UCOL_STRENGTH, UCOL_SECONDARY, &status);
if(U_FAILURE(status)){
log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
return;
}
log_verbose("Testing French Collation with Secondary strength\n");
/*test acute and grave ordering (compare to french collation)*/
testAcuteSize = sizeof(testAcute) / sizeof(testAcute[0]);
for (i = 0; i < testAcuteSize; i++)
{
for (j = 0; j < testAcuteSize; j++)
{
if (i < j) expected = UCOL_LESS;
if (i == j) expected = UCOL_EQUAL;
if (i > j) expected = UCOL_GREATER;
doTest(myCollation, testAcute[i], testAcute[j], expected );
}
}
ucol_close(myCollation);
}
示例12: main
int main()
{
std::mt19937 randomEngine;
std::vector<TreeNode> vecNodes;
std::vector<TreeNode*> vecNodePtrs;
std::vector<int> vecVisitNode;
std::vector<int> vecVisitNodeCmp;
std::vector<int> vecVisitSubtree;
std::vector<int> vecVisitSubtreeCmp;
for (int i = 0; i < 100000; ++i)
{
TreeNode *pRoot = generateRandomBinaryTree(randomEngine,
&vecNodes,
&vecNodePtrs);
bool passed = doTest(pRoot,
&vecVisitNode,
&vecVisitNodeCmp,
&vecVisitSubtree,
&vecVisitSubtreeCmp);
if (!passed)
{
std::printf("Test failed!\n");
break;
}
}
return 0;
}
示例13: selfTest
static void selfTest(uint8_t *src[3], int stride[3], int w, int h){
enum PixelFormat srcFormat, dstFormat;
int srcW, srcH, dstW, dstH;
int flags;
for (srcFormat = 0; srcFormat < PIX_FMT_NB; srcFormat++) {
for (dstFormat = 0; dstFormat < PIX_FMT_NB; dstFormat++) {
printf("%s -> %s\n",
sws_format_name(srcFormat),
sws_format_name(dstFormat));
fflush(stdout);
srcW= w;
srcH= h;
for (dstW=w - w/3; dstW<= 4*w/3; dstW+= w/3){
for (dstH=h - h/3; dstH<= 4*h/3; dstH+= h/3){
for (flags=1; flags<33; flags*=2) {
int res;
res = doTest(src, stride, w, h, srcFormat, dstFormat,
srcW, srcH, dstW, dstH, flags);
if (res < 0) {
dstW = 4 * w / 3;
dstH = 4 * h / 3;
flags = 33;
}
}
}
}
}
}
}
示例14: main
int
main( int argc, char *argv[] )
{
cancel_sm_t a;
cancel_sm_t b;
memset(&a, 0, sizeof(cancel_sm_t));
memset(&b, 0, sizeof(cancel_sm_t));
/* Init PDU ***********************************************************/
b.command_length = 0;
b.command_id = CANCEL_SM;
b.command_status = ESME_ROK;
b.sequence_number = 1;
snprintf((char*)b.service_type, sizeof(b.service_type), "%s", "CMT");
snprintf((char*)b.message_id, sizeof(b.message_id), "%s", "0302830192");
b.source_addr_ton = 2;
b.source_addr_npi = 1;
snprintf((char*)b.source_addr, sizeof(b.source_addr), "%s", "0900001111");
b.dest_addr_ton = 2;
b.dest_addr_npi = 1;
snprintf((char*)b.destination_addr, sizeof(b.source_addr), "%s", "0900001111");
doTest(CANCEL_SM, &a, &b);
return( 0 );
};
示例15: doTest
void CollationTurkishTest::TestTertiary(/* char* par */)
{
int32_t i = 0;
myCollation->setStrength(Collator::TERTIARY);
for (i = 0; i < 8 ; i++) {
doTest(myCollation, testSourceCases[i], testTargetCases[i], results[i]);
}
}