这篇教程C++ ASSERT_LT函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ASSERT_LT函数的典型用法代码示例。如果您正苦于以下问题:C++ ASSERT_LT函数的具体用法?C++ ASSERT_LT怎么用?C++ ASSERT_LT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ASSERT_LT函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: TEST_FTEST_F(TypeRegistryTest, VerifyExteriorModuleRegistration) { // Verify that there are a bunch of registered types in the test application by looking // at the length of the linked list. We expect that there will be at least 2, because of // our declarations in the earlier test in this module, but we also expect there to be // (to choose arbitrarily) around 8, because this is a number of autofired fields known // to exist at one point. // // If the number of autowired members in this unit test drops below 10 at some point, it // might be necessary to reduce the count from 8 to something lower. size_t nTypes = 0; for(auto p = g_pFirstTypeEntry; p; p = p->pFlink) nTypes++; ASSERT_LT(8UL, nTypes) << "Registration failed to pick up the expected minimum number of types in this test"; ASSERT_EQ(g_typeEntryCount, nTypes) << "Linked list did not contain the same number of entries as reported in g_entryCount";}
开发者ID:gtremper,项目名称:autowiring,代码行数:17,
示例2: TESTTEST(Enumerate, Cpp17Support) { std::array<char, 5> test = {"test"}; // Can't use range based for loop until C++17, so test manually // Equivalent to: // for (const auto&& it : folly::enumerate(CStringRange{test.data()})) { ... } { auto&& enumerate = folly::enumerate(CStringRange{test.data()}); auto begin = enumerate.begin(); auto end = enumerate.end(); for (; begin != end; ++begin) { const auto&& it = *begin; ASSERT_LT(it.index, test.size()); EXPECT_EQ(*it, test[it.index]); } }}
开发者ID:JacobMao,项目名称:folly,代码行数:17,
示例3: TEST// Does the PRNG generate random floats with approximately even distribution?TEST(UtilTest, CanGenerateRandomFloats){ const int num_tests = 100000; double avg = 0.0f; for(size_t i = 0; i < num_tests; i++) { float res = rend_randf(); ASSERT_LT(0.0f, res); ASSERT_GE(1.0f, res); avg += res; } avg /= (float)num_tests; double mid = 0.5f; double err = mid / 100.0f; // Test for +/-1% accuracy ASSERT_LE(mid - err, avg); ASSERT_GE(mid + err, avg);}
开发者ID:lmurray,项目名称:rendasaurus,代码行数:18,
示例4: TESTTEST(MoneyTest, comparisons) { ASSERT_LT(change::Money(10, 99), change::Money(11, 10)); ASSERT_LE(change::Money(10, 99), change::Money(11, 10)); ASSERT_EQ(change::Money(10, 99), change::Money(10, 99)); ASSERT_LE(change::Money(10, 99), change::Money(10, 99)); ASSERT_GE(change::Money(10, 99), change::Money(10, 99)); ASSERT_GT(change::Money(11, 00), change::Money(10, 99)); ASSERT_GE(change::Money(11, 00), change::Money(10, 99)); EXPECT_TRUE(change::Money(10, 99) < change::Money(11, 10)); EXPECT_TRUE(change::Money(10, 99) <= change::Money(11, 10)); EXPECT_TRUE(change::Money(10, 99) == change::Money(10, 99)); EXPECT_TRUE(change::Money(10, 99) <= change::Money(10, 99)); EXPECT_TRUE(change::Money(10, 99) >= change::Money(10, 99)); EXPECT_TRUE(change::Money(11, 00) > change::Money(10, 99)); EXPECT_TRUE(change::Money(11, 00) >= change::Money(10, 99)); }
开发者ID:mgalushka,项目名称:cpp-start,代码行数:17,
示例5: TEST_VM// Some basic formula tests with confidence = 0.0TEST_VM(G1Predictions, basic_predictions) { G1Predictions predictor(0.0); TruncatedSeq s; double p0 = predictor.get_new_prediction(&s); ASSERT_LT(p0, epsilon) << "Initial prediction of empty sequence must be 0.0"; s.add(5.0); double p1 = predictor.get_new_prediction(&s); ASSERT_NEAR(p1, 5.0, epsilon); for (int i = 0; i < 40; i++) { s.add(5.0); } double p2 = predictor.get_new_prediction(&s); ASSERT_NEAR(p2, 5.0, epsilon);}
开发者ID:netroby,项目名称:jdk9-dev,代码行数:18,
示例6: maybe_pidvoidSetup::stop_ganesha(){ // The child_pid_ is not necessarily ganesha's - it could be gdbserver's. // So in order to shut things down more or less orderly we send a signal to ganesha // and wait for gdbserver to exit. const boost::optional<pid_t> maybe_pid(ganesha_pid()); if (maybe_pid) { // 2 possibilities: // - gdbserver + ganesha still alive // - ganesha still alive ASSERT_LT(0, child_pid_); LOG_TRACE("Shutting down ganesha @ pid " << *maybe_pid); // For now we need to use SIGKILL as the orderly shutdown with SIGTERM // gets stuck in the shutdown path (cf. OVS-555). int ret = ::kill(*maybe_pid, SIGTERM); ASSERT_EQ(0, ret) << "failed to kill ganesha @ " << *maybe_pid << ": " << strerror(errno); ASSERT_EQ(child_pid_, ::waitpid(child_pid_, &ret, 0)); child_pid_ = -1; } else if (child_pid_ > 0) { // 2 possibilities: // - gdbserver + ganesha not alive anymore // - ganesha not alive anymore (-> zombie) LOG_WARN("We do seem to have a leftover child @ pid " << child_pid_ << " - killing it"); int ret = ::kill(child_pid_, SIGKILL); ASSERT_EQ(0, ret) << "failed to kill ganesha @ pid " << *maybe_pid << ": " << strerror(errno); ASSERT_EQ(child_pid_, ::waitpid(child_pid_, &ret, 0)); child_pid_ = -1; } else { // forking off gdbserver / ganesha failed / never happened LOG_WARN("ganesha not running!?"); }}
开发者ID:bigclouds,项目名称:volumedriver,代码行数:45,
示例7: TESTTEST(bbw, decimated_knight){ Eigen::MatrixXd V,C; Eigen::MatrixXi T,F,E; igl::readMESH(test_common::data_path("decimated-knight.mesh"),V,T,F); igl::readTGF(test_common::data_path("decimated-knight.tgf"),C,E); Eigen::MatrixXd W_groundtruth, Was, Wmo; igl::readDMAT( test_common::data_path("decimated-knight-matlab-active-set.dmat"),W_groundtruth); Eigen::VectorXi b; Eigen::MatrixXd bc; igl::boundary_conditions(V,T,C,Eigen::VectorXi(),E,Eigen::MatrixXi(),b,bc); igl::BBWData params; params.active_set_params.max_iter = 100; igl::bbw(V,T,b,bc,params,Was); igl::writeDMAT("decimated-knight-as.dmat",Was); ASSERT_LT( (Was-W_groundtruth).array().abs().maxCoeff() ,1e-4);}
开发者ID:qnzhou,项目名称:libigl-unit-tests,代码行数:18,
示例8: TEST// Test temperature companding for non-volatile storage.//// 20161016 moved from OpenTRV-Arduino-V0p2 Unit_Tests.cpp testTempCompand().TEST(Stats,TempCompand){ // Ensure that all (whole) temperatures from 0C to 100C are correctly compressed and expanded. for(int16_t i = 0; i <= 100; ++i) { //DEBUG_SERIAL_PRINT(i<<4); DEBUG_SERIAL_PRINT(" => "); DEBUG_SERIAL_PRINT(compressTempC16(i<<4)); DEBUG_SERIAL_PRINT(" => "); DEBUG_SERIAL_PRINT(expandTempC16(compressTempC16(i<<4))); DEBUG_SERIAL_PRINTLN(); ASSERT_EQ(i<<4, OTV0P2BASE::expandTempC16(OTV0P2BASE::compressTempC16(int16_t(i<<4)))); } // Ensure that out-of-range inputs are coerced to the limits. ASSERT_EQ(0, OTV0P2BASE::expandTempC16(OTV0P2BASE::compressTempC16(-1))); ASSERT_EQ((100<<4), OTV0P2BASE::expandTempC16(OTV0P2BASE::compressTempC16(101<<4))); ASSERT_EQ(OTV0P2BASE::COMPRESSION_C16_CEIL_VAL_AFTER, OTV0P2BASE::compressTempC16(102<<4)); // Verify ceiling. ASSERT_LT(OTV0P2BASE::COMPRESSION_C16_CEIL_VAL_AFTER, 0xff); // Ensure that 'unset' compressed value expands to 'unset' uncompressed value. const int16_t ui = OTV0P2BASE::NVByHourByteStatsBase::UNSET_INT; const uint8_t ub = OTV0P2BASE::NVByHourByteStatsBase::UNSET_BYTE; ASSERT_EQ(ui, OTV0P2BASE::expandTempC16(ub));}
开发者ID:opentrv,项目名称:OTRadioLink,代码行数:21,
示例9: TESTTEST(uuid, generator){ cxx::sys::uuid u1 = cxx::sys::nil_uuid()(); printf("u1=%s/n", cxx::sys::to_string(u1).c_str()); ASSERT_EQ(u1.is_null(), true); cxx::sys::uuid u2 = cxx::sys::sys_uuid()(); printf("u2=%s/n", cxx::sys::to_string(u2).c_str()); ASSERT_EQ(u2.is_null(), false); ASSERT_NE(u1, u2); ASSERT_LT(u1, u2); std::size_t h1 = u1.hash(); std::size_t h2 = u2.hash(); ASSERT_NE(h1, h2);}
开发者ID:zigzed,项目名称:common,代码行数:18,
示例10: TEST_FTEST_F(PhyloTreeTest, PrefixCoding) { vector<PhyloTreeNode*> nodes1 = Fasta::readFastaFile("tests/aligned.fasta"); PhyloTree t; t.setEvolutionModel(new Kimura(10.0)); t.buildRandomTree(nodes1); double lh1 = t.logLikelihood(); ASSERT_LT(lh1, 0.0); string prefixCoded = PhyloTreeNode::prefixRepresentation(t.getRoot()); vector<PhyloTreeNode*> nodes2 = Fasta::readFastaFile("tests/aligned.fasta"); PhyloTree t2 = PhyloTree::decodePrefixNotation(nodes2, prefixCoded, new Kimura(10.0)); double lh2 = t.logLikelihood(); ASSERT_DOUBLE_EQ(lh1, lh2);}
开发者ID:ehamberg,项目名称:phyloea,代码行数:18,
示例11: TESTTEST(liblog, concurrent_name(__android_log_buf_print, NUM_CONCURRENT)) { pthread_t t[NUM_CONCURRENT]; int i; for (i=0; i < NUM_CONCURRENT; i++) { ASSERT_EQ(0, pthread_create(&t[i], NULL, ConcurrentPrintFn, reinterpret_cast<void *>(i))); } int ret = 0; for (i=0; i < NUM_CONCURRENT; i++) { void* result; ASSERT_EQ(0, pthread_join(t[i], &result)); if ((0 == ret) && (0 != reinterpret_cast<int>(result))) { ret = reinterpret_cast<int>(result); } } ASSERT_LT(0, ret);}
开发者ID:davidbrazdil,项目名称:cheri-art_system_core,代码行数:18,
示例12: TEST TEST(xphoto_DenoisingBm3dGrayscale, regression_L2_8x8) { std::string folder = std::string(cvtest::TS::ptr()->get_data_path()) + "cv/xphoto/bm3d_image_denoising/"; std::string original_path = folder + "lena_noised_gaussian_sigma=10.png"; std::string expected_path = folder + "lena_noised_denoised_bm3d_grayscale_l2_tw=8_sw=16_h=10_bm=2500.png"; cv::Mat original = cv::imread(original_path, cv::IMREAD_GRAYSCALE); cv::Mat expected = cv::imread(expected_path, cv::IMREAD_GRAYSCALE); ASSERT_FALSE(original.empty()) << "Could not load input image " << original_path; ASSERT_FALSE(expected.empty()) << "Could not load reference image " << expected_path; cv::Mat result; cv::xphoto::bm3dDenoising(original, result, 10, 8, 16, 2500, -1, 8, 1, 0.0f, cv::NORM_L2, cv::xphoto::BM3D_STEP1); DUMP(result, expected_path + ".res.png"); ASSERT_LT(cvtest::norm(result, expected, cv::NORM_L2), 200); }
开发者ID:AmbroiseMoreau,项目名称:opencv_contrib,代码行数:19,
示例13: TEST_FTEST_F(MPIProfileTest, outer_sync){ struct geopm_prof_c *prof; uint64_t region_id[4]; int rank; int num_node = 0; (void) geopm_comm_num_node(MPI_COMM_WORLD, &num_node); ASSERT_LT(1, num_node); MPI_Comm_rank(MPI_COMM_WORLD, &rank); ASSERT_EQ(0, geopm_prof_create("outer_sync_test", m_shm_key, MPI_COMM_WORLD, &prof)); for (int i = 0; i < 3; i++) { ASSERT_EQ(0, geopm_prof_outer_sync(prof)); ASSERT_EQ(0, geopm_prof_region(prof, "loop_one", GEOPM_POLICY_HINT_UNKNOWN, ®ion_id[0])); ASSERT_EQ(0, geopm_prof_enter(prof, region_id[0])); sleep_exact(1.0); ASSERT_EQ(0, geopm_prof_exit(prof, region_id[0])); ASSERT_EQ(0, geopm_prof_region(prof, "loop_two", GEOPM_POLICY_HINT_UNKNOWN, ®ion_id[1])); ASSERT_EQ(0, geopm_prof_enter(prof, region_id[1])); sleep_exact(2.0); ASSERT_EQ(0, geopm_prof_exit(prof, region_id[1])); ASSERT_EQ(0, geopm_prof_region(prof, "loop_three", GEOPM_POLICY_HINT_UNKNOWN, ®ion_id[2])); ASSERT_EQ(0, geopm_prof_enter(prof, region_id[2])); sleep_exact(3.0); ASSERT_EQ(0, geopm_prof_exit(prof, region_id[2])); MPI_Barrier(MPI_COMM_WORLD); } ASSERT_EQ(0, geopm_prof_print(prof, m_log_file.c_str(), 0)); if (m_is_node_root) { ASSERT_EQ(0, parse_log_loop()); } ASSERT_EQ(0, geopm_prof_destroy(prof));}
开发者ID:bgeltz,项目名称:geopm,代码行数:43,
示例14: ASSERT_LTvoid block_writer::open_segment(size_t segmentid, std::string filename) { ASSERT_LT(segmentid, m_index_info.nsegments); ASSERT_TRUE(m_output_files[segmentid] == nullptr); m_output_files[segmentid].reset(new general_ofstream(filename, /* must not compress! * We need the blocks!*/ false)); m_index_info.segment_files[segmentid] = filename; // update the per column segment file for (size_t col = 0;col < m_index_info.columns.size(); ++col) { m_index_info.columns[col].segment_files[segmentid] = m_index_info.segment_files[segmentid] + ":" + std::to_string(col); } if (m_output_files[segmentid]->fail()) { log_and_throw("Unable to open segment data file " + filename); }}
开发者ID:GYGit,项目名称:SFrame,代码行数:19,
示例15: TESTTEST(time, clock_gettime) { // Try to ensure that our vdso clock_gettime is working. timespec ts1; ASSERT_EQ(0, clock_gettime(CLOCK_MONOTONIC, &ts1)); timespec ts2; ASSERT_EQ(0, syscall(__NR_clock_gettime, CLOCK_MONOTONIC, &ts2)); // What's the difference between the two? ts2.tv_sec -= ts1.tv_sec; ts2.tv_nsec -= ts1.tv_nsec; if (ts2.tv_nsec < 0) { --ts2.tv_sec; ts2.tv_nsec += NS_PER_S; } // Should be less than (a very generous, to try to avoid flakiness) 1000000ns. ASSERT_EQ(0, ts2.tv_sec); ASSERT_LT(ts2.tv_nsec, 1000000);}
开发者ID:nfxosp,项目名称:platform_bionic,代码行数:19,
示例16: TESTTEST(testTKpoly, quadratic){ const int m=3; const int n=1024; const double A = 1.0; const double B = 100.0; const double C = 1123.123; double x[n]; double y[n]; double Y[n]; double p[m]; double q[m]; q[0]=q[1]=q[2]=0; long double d = 1.0L/static_cast<long double>(n); for (int i = 0; i < n; i++){ long double ix = static_cast<long double>(i-n/2) * d; x[i] = static_cast<double>(ix); y[i] = A + ix*B + ix*ix*C; Y[i] = A + ix*B + ix*ix*C; } useT2accel=1; int itr=1; while(itr < 10){ TKfindPoly_d(x,y,n,m,p); q[0] += p[0]; q[1] += p[1]; q[2] += p[2]; if ( (fabs(q[0] - A) < FIT_EPSILON) && (fabs(q[1] - B) < FIT_EPSILON) && (fabs(q[2] - C) < FIT_EPSILON) ) break; for (int i = 0; i < n; i++){ long double ix = static_cast<long double>(i-n/2) * d; y[i] = Y[i] - (q[0] + ix*q[1] + ix*ix*q[2]); } itr++; } ASSERT_LT(itr,3);}
开发者ID:gdesvignes,项目名称:tempo2,代码行数:42,
示例17: TESTTEST(MallocTests, HeapInformation) { HANDLE heap = GetProcessHeap(); ASSERT_NE(heap, (HANDLE)NULL); ULONG heap_type; SIZE_T got; BOOL res = HeapQueryInformation(heap, HeapCompatibilityInformation, &heap_type, sizeof(heap_type), &got); ASSERT_EQ(res, TRUE); ASSERT_EQ(got, sizeof(heap_type)); ASSERT_LT(heap_type, 3); /* 0, 1, 2 are the only valid values */ heap_type = 2; res = HeapSetInformation(heap, HeapCompatibilityInformation, &heap_type, sizeof(heap_type)); ASSERT_EQ(res, TRUE); heap_type = 2; res = HeapSetInformation(heap, HeapEnableTerminationOnCorruption, NULL, 0); ASSERT_EQ(res, TRUE);}
开发者ID:Maximus5,项目名称:drmemory,代码行数:20,
示例18: TESTTEST(Core_DFT, complex_output2){ for( int i = 0; i < 100; i++ ) { int type = theRNG().uniform(0, 2) ? CV_64F : CV_32F; int m = theRNG().uniform(1, 10); int n = theRNG().uniform(1, 10); Mat x(m, n, type), out; randu(x, -1., 1.); dft(x, out, DFT_ROWS | DFT_COMPLEX_OUTPUT); double nrm = cvtest::norm(out, NORM_INF); double thresh = n*m*2; if( nrm > thresh ) { cout << "x: " << x << endl; cout << "out: " << out << endl; ASSERT_LT(nrm, thresh); } }}
开发者ID:AliMiraftab,项目名称:opencv,代码行数:20,
示例19: TEST_VMTEST_VM(LogDecorations, uptime) { // Verify the format of the decoration int a, b; char decimal_point; LogDecorations decorations(LogLevel::Info, tagset, default_decorators); const char* uptime = decorations.decoration(LogDecorators::uptime_decorator); int read = sscanf(uptime, "%d%c%ds", &a, &decimal_point, &b); EXPECT_EQ(3, read) << "Invalid uptime decoration: " << uptime; EXPECT_TRUE(decimal_point == '.' || decimal_point == ',') << "Invalid uptime decoration: " << uptime; // Verify that uptime increases double prev = 0; for (int i = 0; i < 3; i++) { os::naked_short_sleep(10); LogDecorations d(LogLevel::Info, tagset, default_decorators); double cur = strtod(d.decoration(LogDecorators::uptime_decorator), NULL); ASSERT_LT(prev, cur); prev = cur; }}
开发者ID:netroby,项目名称:jdk9-dev,代码行数:20,
示例20: TESTTEST(sysdeps_thread, join) { std::atomic<int> counter(0); std::vector<adb_thread_t> threads(500); for (size_t i = 0; i < threads.size(); ++i) { ASSERT_TRUE(adb_thread_create(increment_atomic_int, &counter, &threads[i])); } int current = counter.load(); ASSERT_GE(current, 0); // Make sure that adb_thread_create actually creates threads, and doesn't do something silly // like synchronously run the function passed in. The sleep in increment_atomic_int should be // enough to keep this from being flakey. ASSERT_LT(current, 500); for (const auto& thread : threads) { ASSERT_TRUE(adb_thread_join(thread)); } ASSERT_EQ(500, counter.load());}
开发者ID:debian-pkg-android-tools,项目名称:android-platform-system-core,代码行数:20,
示例21: TESTTEST(TextSearcherICUTest, FindSubstring) { TextSearcherICU searcher; const String& pattern = makeUTF16("substring"); searcher.setPattern(pattern, true); const String& text = makeUTF16("Long text with substring content."); searcher.setText(text.characters16(), text.length()); MatchResult result; EXPECT_TRUE(searcher.nextMatchResult(result)); EXPECT_NE(0u, result.start); EXPECT_NE(0u, result.length); ASSERT_LT(result.length, text.length()); EXPECT_EQ(pattern, text.substring(result.start, result.length)); EXPECT_FALSE(searcher.nextMatchResult(result)); EXPECT_EQ(0u, result.start); EXPECT_EQ(0u, result.length);}
开发者ID:mirror,项目名称:chromium,代码行数:20,
示例22: TEST // Insert multiple keys and try to iterate through all of them // using a forward cursor while calling savePosition() and // restorePosition() in succession. TEST( SortedDataInterface, SaveAndRestorePositionWhileIterateCursor ) { const std::unique_ptr<HarnessHelper> harnessHelper( newHarnessHelper() ); const std::unique_ptr<SortedDataInterface> sorted( harnessHelper->newSortedDataInterface( false ) ); { const std::unique_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() ); ASSERT( sorted->isEmpty( opCtx.get() ) ); } int nToInsert = 10; for ( int i = 0; i < nToInsert; i++ ) { const std::unique_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() ); { WriteUnitOfWork uow( opCtx.get() ); BSONObj key = BSON( "" << i ); RecordId loc( 42, i * 2 ); ASSERT_OK( sorted->insert( opCtx.get(), key, loc, true ) ); uow.commit(); } } { const std::unique_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() ); ASSERT_EQUALS( nToInsert, sorted->numEntries( opCtx.get() ) ); } { const std::unique_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() ); const std::unique_ptr<SortedDataInterface::Cursor> cursor( sorted->newCursor(opCtx.get()) ); int i = 0; for (auto entry = cursor->seek(minKey, true); entry; i++, entry = cursor->next()) { ASSERT_LT(i, nToInsert); ASSERT_EQ(entry, IndexKeyEntry(BSON( "" << i), RecordId(42, i * 2))); cursor->savePositioned(); cursor->restore( opCtx.get() ); } ASSERT( !cursor->next() ); ASSERT_EQ(i, nToInsert); } }
开发者ID:7segments,项目名称:mongo-1,代码行数:44,
示例23: TEST_FTEST_F(WingComponentSegment2, tiglWingComponentGetEtaXsi_success){ double eta = 0.3336; double xsi = 0.; char * wingUID = NULL; char * segmentUID = NULL; double segmentEta = 0., segmentXsi = 0.; double errorDistance = 0; TiglReturnCode ret = tiglWingComponentSegmentPointGetSegmentEtaXsi(tiglHandle, "D250_wing_CS", eta, xsi, &wingUID, &segmentUID, &segmentEta, &segmentXsi, &errorDistance); ASSERT_EQ(TIGL_SUCCESS, ret); ASSERT_LT(errorDistance, 1e-2); ASSERT_STREQ("D250_wing", wingUID); eta = 0.; xsi = 0.5; ret = tiglWingComponentSegmentPointGetSegmentEtaXsi(tiglHandle, "D250_wing_CS", eta, xsi, &wingUID, &segmentUID, &segmentEta, &segmentXsi, &errorDistance); ASSERT_EQ(TIGL_SUCCESS, ret); ASSERT_STREQ("D250_wing", wingUID);}
开发者ID:DLR-SC,项目名称:tigl,代码行数:21,
示例24: TEST_F TEST_F(CTestInterfaceBase, incr_TestCase_15_overflow) { data_entry key("13_15_key_01"); int area = 1; int retValue = 0; int count = 0x7FFFFFFF; int ret; client_handle.remove(area, key); DO_WITH_RETRY(client_handle.incr(area, key, count, &retValue), ret, TAIR_RETURN_SUCCESS); ASSERT_EQ(TAIR_RETURN_SUCCESS, ret); ASSERT_EQ(count, retValue); count = 1; int initValue = 1; DO_WITH_RETRY(client_handle.incr(area, key, count, &retValue, initValue, 0), ret, TAIR_RETURN_SUCCESS); ASSERT_EQ(TAIR_RETURN_SUCCESS, ret); ASSERT_LT(retValue, 0); client_handle.remove(area, key); };
开发者ID:xiangyong,项目名称:platform,代码行数:22,
示例25: TESTTEST(AMF0Test, DecodeStringLongUtf8){ // Generate long (>65535 bytes) UTF-8 string QString str = QStringLiteral("/xE3/x81/x82 /xE3/x81/x84 "); // Japanese A and I str.append(QString(21845, QChar(0x3046))); // Japanese U str.append(QStringLiteral(" /xE3/x81/x88")); // Japanese E uint utf8Len = str.toUtf8().length(); ASSERT_LT(65535U, utf8Len); AMFString val(str); QByteArray data = val.serialized(); AMFType *out = NULL; uint outSize = AMFType::decode(data.constData(), &out); AMFString *outVal = out->asString(); ASSERT_FALSE(outVal == NULL); EXPECT_EQ(5 + utf8Len, outSize); EXPECT_EQ(val, *outVal); delete out;}
开发者ID:mishira,项目名称:libbroadcast,代码行数:22,
示例26: TEST// Not an ideal test, but try to check that the async version runs faster than the sync equivalent.TEST(AsyncForEach, TestMapSpeed){ typedef std::chrono::high_resolution_clock clock; auto testFunction = [](int) { std::this_thread::sleep_for(std::chrono::milliseconds(100)); }; std::vector<int> data(20); auto asyncStart = clock::now(); async_for_each(data.begin(), data.end(), testFunction); auto asyncFinish = clock::now(); auto asyncTime = std::chrono::duration_cast<std::chrono::microseconds>(asyncFinish - asyncStart).count(); auto syncStart = clock::now(); std::for_each(data.begin(), data.end(), testFunction); auto syncFinish = clock::now(); auto syncTime = std::chrono::duration_cast<std::chrono::microseconds>(syncFinish - syncStart).count(); ASSERT_LT(asyncTime, syncTime);}
开发者ID:mlove-au,项目名称:utils,代码行数:23,
注:本文中的ASSERT_LT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ASSERT_M函数代码示例 C++ ASSERT_LOG函数代码示例 |