这篇教程C++ ASSERT_ALWAYS函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ASSERT_ALWAYS函数的典型用法代码示例。如果您正苦于以下问题:C++ ASSERT_ALWAYS函数的具体用法?C++ ASSERT_ALWAYS怎么用?C++ ASSERT_ALWAYS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ASSERT_ALWAYS函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: check_inf_nanstatic voidcheck_inf_nan (void){ /* only if nans and infs are available */#if _GMP_IEEE_FLOATS && !defined(MPFR_ERRDIVZERO) mpfr_t x; double d; mpfr_init2 (x, 123); mpfr_set_inf (x, 1); d = mpfr_get_d (x, MPFR_RNDZ); ASSERT_ALWAYS (d > 0); ASSERT_ALWAYS (DOUBLE_ISINF (d)); mpfr_set_inf (x, -1); d = mpfr_get_d (x, MPFR_RNDZ); ASSERT_ALWAYS (d < 0); ASSERT_ALWAYS (DOUBLE_ISINF (d)); mpfr_set_nan (x); d = mpfr_get_d (x, MPFR_RNDZ); ASSERT_ALWAYS (DOUBLE_ISNAN (d)); mpfr_clear (x);#endif}
开发者ID:Canar,项目名称:mpfr,代码行数:27,
示例2: check_inf_nanstatic voidcheck_inf_nan (void){ /* only if nans and infs are available */#if _GMP_IEEE_FLOATS mpfr_t x; double d; long exp; mpfr_init2 (x, 123); mpfr_set_inf (x, 1); d = mpfr_get_d_2exp (&exp, x, MPFR_RNDZ); ASSERT_ALWAYS (d > 0); ASSERT_ALWAYS (DOUBLE_ISINF (d)); mpfr_set_inf (x, -1); d = mpfr_get_d_2exp (&exp, x, MPFR_RNDZ); ASSERT_ALWAYS (d < 0); ASSERT_ALWAYS (DOUBLE_ISINF (d)); mpfr_set_nan (x); d = mpfr_get_d_2exp (&exp, x, MPFR_RNDZ); ASSERT_ALWAYS (DOUBLE_ISNAN (d)); mpfr_clear (x);#endif}
开发者ID:Distrotech,项目名称:mpfr,代码行数:28,
示例3: fun_fscanfintfun_fscanf (const char *input, const char *fmt, void *a1, void *a2){ FILE *fp; int ret; fp = fopen (TEMPFILE, "w+"); ASSERT_ALWAYS (fp != NULL); ASSERT_ALWAYS (fputs (input, fp) != EOF); ASSERT_ALWAYS (fflush (fp) == 0); rewind (fp); if (a2 == NULL) ret = fscanf (fp, fmt, a1); else ret = fscanf (fp, fmt, a1, a2); got_ftell = ftell (fp); ASSERT_ALWAYS (got_ftell != -1L); fromstring_next_c = getc (fp); ASSERT_ALWAYS (fclose (fp) == 0); return ret;}
开发者ID:KrisChaplin,项目名称:LRT2x4_v1.0.2.06_GPL_source,代码行数:25,
示例4: xrange/*max_freq = 10000000for prescaler in xrange(int(TIMEVT_INPUT_CLOCK / float(max_freq) + 0.5), 65535 + 1): if TIMEVT_INPUT_CLOCK % prescaler: continue if int(1e9) % (TIMEVT_INPUT_CLOCK / prescaler): continue print prescaler, TIMEVT_INPUT_CLOCK / prescaler, int(1e9) / (TIMEVT_INPUT_CLOCK / prescaler) */void motor_timer_init(void){ chSysDisable(); // Power-on and reset TIMEVT_RCC_ENR |= TIMEVT_RCC_ENR_MASK; TIMEVT_RCC_RSTR |= TIMEVT_RCC_RSTR_MASK; TIMEVT_RCC_RSTR &= ~TIMEVT_RCC_RSTR_MASK; TIMSTP_RCC_ENR |= TIMSTP_RCC_ENR_MASK; TIMSTP_RCC_RSTR |= TIMSTP_RCC_RSTR_MASK; TIMSTP_RCC_RSTR &= ~TIMSTP_RCC_RSTR_MASK; chSysEnable(); // Find the optimal prescaler value uint32_t prescaler = (uint32_t)(TIMEVT_INPUT_CLOCK / ((float)MAX_FREQUENCY)); // Initial value if (prescaler < 1) prescaler = 1; for (;; prescaler++) { ASSERT_ALWAYS(prescaler < 0xFFFF); if (TIMEVT_INPUT_CLOCK % prescaler) { continue; } const uint32_t prescaled_clock = TIMEVT_INPUT_CLOCK / prescaler; if (INT_1E9 % prescaled_clock) { continue; } break; // Ok, current prescaler value can divide the timer frequency with no remainder } _nanosec_per_tick = INT_1E9 / (TIMEVT_INPUT_CLOCK / prescaler); ASSERT_ALWAYS(_nanosec_per_tick < 1000); // Make sure it is sane printf("Motor: Timer resolution: %u nanosec/n", (unsigned)_nanosec_per_tick); // Enable IRQ nvicEnableVector(TIMEVT_IRQn, MOTOR_IRQ_PRIORITY_MASK); nvicEnableVector(TIMSTP_IRQn, MOTOR_IRQ_PRIORITY_MASK); // Start the event timer TIMEVT->ARR = 0xFFFF; TIMEVT->PSC = (uint16_t)(prescaler - 1); TIMEVT->CR1 = TIM_CR1_URS; TIMEVT->SR = 0; TIMEVT->EGR = TIM_EGR_UG; // Reload immediately TIMEVT->CR1 = TIM_CR1_CEN; // Start // Start the timestamping timer TIMSTP->ARR = 0xFFFF; TIMSTP->PSC = (uint16_t)(prescaler - 1); TIMSTP->CR1 = TIM_CR1_URS; TIMSTP->SR = 0; TIMSTP->EGR = TIM_EGR_UG; // Reload immediately TIMSTP->DIER = TIM_DIER_UIE; TIMSTP->CR1 = TIM_CR1_CEN; // Start}
开发者ID:Aerobota,项目名称:sapog,代码行数:67,
示例5: adc_calibratestatic void adc_calibrate(ADC_TypeDef* const adc){ // RSTCAL ASSERT_ALWAYS(!(adc->CR2 & ADC_CR2_RSTCAL)); adc->CR2 |= ADC_CR2_RSTCAL; while (adc->CR2 & ADC_CR2_RSTCAL) { } // CAL ASSERT_ALWAYS(!(adc->CR2 & ADC_CR2_CAL)); adc->CR2 |= ADC_CR2_CAL; while (adc->CR2 & ADC_CR2_CAL) { }}
开发者ID:branux,项目名称:sapog,代码行数:12,
示例6: hubii_eint_initvoidhubii_eint_init(cnodeid_t cnode){ int bit, rv; ii_iidsr_u_t hubio_eint; hubinfo_t hinfo; cpuid_t intr_cpu; devfs_handle_t hub_v; ii_ilcsr_u_t ilcsr; int bit_pos_to_irq(int bit); int synergy_intr_connect(int bit, int cpuid); hub_v = (devfs_handle_t)cnodeid_to_vertex(cnode); ASSERT_ALWAYS(hub_v); hubinfo_get(hub_v, &hinfo); ASSERT(hinfo); ASSERT(hinfo->h_cnodeid == cnode); ilcsr.ii_ilcsr_regval = REMOTE_HUB_L(hinfo->h_nasid, IIO_ILCSR); if ((ilcsr.ii_ilcsr_fld_s.i_llp_stat & 0x2) == 0) { /* * HUB II link is not up. * Just disable LLP, and don't connect any interrupts. */ ilcsr.ii_ilcsr_fld_s.i_llp_en = 0; REMOTE_HUB_S(hinfo->h_nasid, IIO_ILCSR, ilcsr.ii_ilcsr_regval); return; } /* Select a possible interrupt target where there is a free interrupt * bit and also reserve the interrupt bit for this IO error interrupt */ intr_cpu = intr_heuristic(hub_v,0,INTRCONNECT_ANYBIT,II_ERRORINT,hub_v, "HUB IO error interrupt",&bit); if (intr_cpu == CPU_NONE) { printk("hubii_eint_init: intr_reserve_level failed, cnode %d", cnode); return; } rv = intr_connect_level(intr_cpu, bit, 0, NULL); synergy_intr_connect(bit, intr_cpu); request_irq(bit_pos_to_irq(bit) + (intr_cpu << 8), hubii_eint_handler, 0, "SN hub error", (void *)hub_v); ASSERT_ALWAYS(rv >= 0); hubio_eint.ii_iidsr_regval = 0; hubio_eint.ii_iidsr_fld_s.i_enable = 1; hubio_eint.ii_iidsr_fld_s.i_level = bit;/* Take the least significant bits*/ hubio_eint.ii_iidsr_fld_s.i_node = COMPACT_TO_NASID_NODEID(cnode); hubio_eint.ii_iidsr_fld_s.i_pi_id = cpuid_to_subnode(intr_cpu); REMOTE_HUB_S(hinfo->h_nasid, IIO_IIDSR, hubio_eint.ii_iidsr_regval);}
开发者ID:ya-mouse,项目名称:cnu-680pro,代码行数:53,
示例7: hubii_eint_initvoidhubii_eint_init(cnodeid_t cnode){ int bit, rv; ii_iidsr_u_t hubio_eint; hubinfo_t hinfo; cpuid_t intr_cpu; vertex_hdl_t hub_v; int bit_pos_to_irq(int bit); ii_ilcsr_u_t ilcsr; hub_v = (vertex_hdl_t)cnodeid_to_vertex(cnode); ASSERT_ALWAYS(hub_v); hubinfo_get(hub_v, &hinfo); ASSERT(hinfo); ASSERT(hinfo->h_cnodeid == cnode); ilcsr.ii_ilcsr_regval = REMOTE_HUB_L(hinfo->h_nasid, IIO_ILCSR); if ((ilcsr.ii_ilcsr_fld_s.i_llp_stat & 0x2) == 0) { /* * HUB II link is not up. Disable LLP. Clear old errors. * Enable interrupts to handle BTE errors. */ ilcsr.ii_ilcsr_fld_s.i_llp_en = 0; REMOTE_HUB_S(hinfo->h_nasid, IIO_ILCSR, ilcsr.ii_ilcsr_regval); } /* Select a possible interrupt target where there is a free interrupt * bit and also reserve the interrupt bit for this IO error interrupt */ intr_cpu = intr_heuristic(hub_v,0,SGI_II_ERROR,0,hub_v, "HUB IO error interrupt",&bit); if (intr_cpu == CPU_NONE) { printk("hubii_eint_init: intr_reserve_level failed, cnode %d", cnode); return; } rv = intr_connect_level(intr_cpu, SGI_II_ERROR, 0, NULL); request_irq(SGI_II_ERROR, hubii_eint_handler, SA_SHIRQ, "SN_hub_error", (void *)hub_v); irq_desc(bit)->status |= SN2_IRQ_PER_HUB; ASSERT_ALWAYS(rv >= 0); hubio_eint.ii_iidsr_regval = 0; hubio_eint.ii_iidsr_fld_s.i_enable = 1; hubio_eint.ii_iidsr_fld_s.i_level = bit;/* Take the least significant bits*/ hubio_eint.ii_iidsr_fld_s.i_node = COMPACT_TO_NASID_NODEID(cnode); hubio_eint.ii_iidsr_fld_s.i_pi_id = cpuid_to_subnode(intr_cpu); REMOTE_HUB_S(hinfo->h_nasid, IIO_IIDSR, hubio_eint.ii_iidsr_regval);}
开发者ID:romanalexander,项目名称:Trickles,代码行数:51,
示例8: check_onevoidcheck_one (mpf_srcptr src, mpf_srcptr trunc, mpf_srcptr ceil, mpf_srcptr floor){ mpf_t got; mpf_init2 (got, mpf_get_prec (trunc)); ASSERT_ALWAYS (PREC(got) == PREC(trunc)); ASSERT_ALWAYS (PREC(got) == PREC(ceil)); ASSERT_ALWAYS (PREC(got) == PREC(floor));#define CHECK_SEP(name, fun, want) / mpf_set_ui (got, 54321L); /* initial junk */ / fun (got, src); / MPF_CHECK_FORMAT (got); / if (mpf_cmp (got, want) != 0) / { / printf ("%s wrong/n", name); / check_print (src, got, want); / abort (); / } CHECK_SEP ("mpf_trunc", mpf_trunc, trunc); CHECK_SEP ("mpf_ceil", mpf_ceil, ceil); CHECK_SEP ("mpf_floor", mpf_floor, floor);#define CHECK_INPLACE(name, fun, want) / mpf_set (got, src); / fun (got, got); / MPF_CHECK_FORMAT (got); / if (mpf_cmp (got, want) != 0) / { / printf ("%s wrong/n", name); / check_print (src, got, want); / abort (); / } CHECK_INPLACE ("mpf_trunc", mpf_trunc, trunc); /* Can't do these unconditionally in case truncation by mpf_set strips some low non-zero limbs which would have rounded the result. */ if (ABSIZ(src) <= PREC(trunc)+1) { CHECK_INPLACE ("mpf_ceil", mpf_ceil, ceil); CHECK_INPLACE ("mpf_floor", mpf_floor, floor); } mpf_clear (got);}
开发者ID:AllardJ,项目名称:Tomato,代码行数:48,
示例9: check_fib_tablevoidcheck_fib_table (void){ int i; for (i = 1; i <= FIB_TABLE_LIMIT; i++) ASSERT_ALWAYS (FIB_TABLE(i) != 0);}
开发者ID:mahdiz,项目名称:mpclib,代码行数:7,
示例10: mlresetvoidmlreset(int slave){ if (!slave) { /* * We are the master cpu and node. */ master_nasid = get_nasid(); set_master_bridge_base(); /* We're the master processor */ master_procid = smp_processor_id(); master_nasid = cpuid_to_nasid(master_procid); /* * master_nasid we get back better be same as one from * get_nasid() */ ASSERT_ALWAYS(master_nasid == get_nasid()); /* early initialization of iograph */ iograph_early_init(); /* Initialize Hub Pseudodriver Management */ hubdev_init(); } else { /* slave != 0 */ /* * This code is performed ONLY by slave processors. */ }}
开发者ID:dduval,项目名称:kernel-rhel3,代码行数:33,
示例11: mpn_redc_nvoidmpn_redc_n (mp_ptr rp, mp_ptr up, mp_srcptr mp, mp_size_t n, mp_srcptr ip){ mp_ptr xp, yp, scratch; mp_limb_t cy; mp_size_t rn; TMP_DECL; TMP_MARK; ASSERT (n > 8); rn = mpn_mulmod_bnm1_next_size (n); scratch = TMP_ALLOC_LIMBS (n + rn + mpn_mulmod_bnm1_itch (rn, n, n)); xp = scratch; mpn_mullo_n (xp, up, ip, n); yp = scratch + n; mpn_mulmod_bnm1 (yp, rn, xp, n, mp, n, scratch + n + rn); ASSERT_ALWAYS (2 * n > rn); /* could handle this */ cy = mpn_sub_n (yp + rn, yp, up, 2*n - rn); /* undo wrap around */ MPN_DECR_U (yp + 2*n - rn, rn, cy); cy = mpn_sub_n (rp, up + n, yp + n, n); if (cy != 0) mpn_add_n (rp, rp, mp, n); TMP_FREE;}
开发者ID:AlexeiSheplyakov,项目名称:gmp.pkg,代码行数:32,
示例12: check_variousvoidcheck_various (void){ mpf_t got; mpq_t q; mpf_init (got); mpq_init (q); /* 1/1 == 1 */ mpf_set_prec (got, 20L); mpq_set_ui (q, 1L, 1L); mpf_set_q (got, q); MPF_CHECK_FORMAT (got); ASSERT_ALWAYS (mpf_cmp_ui (got, 1L) == 0); /* 1/(2^n+1), a case where truncating the divisor would be wrong */ mpf_set_prec (got, 500L); mpq_set_ui (q, 1L, 1L); mpz_mul_2exp (mpq_denref(q), mpq_denref(q), 800L); mpz_add_ui (mpq_denref(q), mpq_denref(q), 1L); check_one (got, q); mpf_clear (got); mpq_clear (q);}
开发者ID:BrianGladman,项目名称:mpir,代码行数:26,
示例13: check_variousvoidcheck_various (void){ mpf_t got, u, v; mpf_init (got); mpf_init (u); mpf_init (v); /* 100/4 == 25 */ mpf_set_prec (got, 20L); mpf_set_ui (u, 100L); mpf_set_ui (v, 4L); mpf_div (got, u, v); MPF_CHECK_FORMAT (got); ASSERT_ALWAYS (mpf_cmp_ui (got, 25L) == 0); /* 1/(2^n+1), a case where truncating the divisor would be wrong */ mpf_set_prec (got, 500L); mpf_set_prec (v, 900L); mpf_set_ui (v, 1L); mpf_mul_2exp (v, v, 800L); mpf_add_ui (v, v, 1L); mpf_div (got, u, v); check_one ("1/2^n+1, separate", got, u, v); mpf_clear (got); mpf_clear (u); mpf_clear (v);}
开发者ID:AlexeiSheplyakov,项目名称:gmp.pkg,代码行数:30,
示例14: _vic_set_interrupt_vectorvoid _vic_set_interrupt_vector(OS_InterruptVector isr, UINT32 index){ // VIC0 if(index < 32) { *VIC0VECTADDR(index) = (UINT32) isr; } // VIC1 else if(index < 64) { *VIC1VECTADDR(index - 32) = (UINT32) isr; } // VIC2 else if(index < 96) { *VIC2VECTADDR(index - 64) = (UINT32) isr; } // VIC3 else if(index < 128) { *VIC3VECTADDR(index - 96) = (UINT32) isr; } else { ASSERT_ALWAYS("Invalid interrupt index"); } return;}
开发者ID:bbhat,项目名称:charm,代码行数:29,
示例15: check_onevoidcheck_one (const char *desc, mpf_ptr got, mpf_srcptr u, mpir_ui v){ mp_size_t usize, usign; mp_ptr wp; mpf_t want; MPF_CHECK_FORMAT (got); /* this code not nailified yet */ ASSERT_ALWAYS (BITS_PER_UI <= GMP_NUMB_BITS); usign = SIZ (u); usize = ABS (usign); wp = refmpn_malloc_limbs (usize + 1); wp[usize] = mpn_mul_1 (wp, PTR(u), usize, (mp_limb_t) v); PTR(want) = wp; SIZ(want) = (usign >= 0 ? usize+1 : -(usize+1)); EXP(want) = EXP(u) + 1; refmpf_normalize (want); if (! refmpf_validate ("mpf_mul_ui", got, want)) { mp_trace_base = -16; printf (" %s/n", desc); mpf_trace (" u", u); printf (" v %ld 0x%lX/n", v, v); abort (); } free (wp);}
开发者ID:BrianGladman,项目名称:mpir,代码行数:32,
示例16: mpz_to_mpnstatic voidmpz_to_mpn (mp_ptr ap, mp_size_t an, const mpz_t b){ mp_size_t bn = mpz_size (b); ASSERT_ALWAYS (bn <= an); MPN_COPY_INCR (ap, mpz_limbs_read (b), bn); MPN_ZERO (ap + bn, an - bn);}
开发者ID:ChristopherRussell,项目名称:gap,代码行数:8,
示例17: my__gmpn_tdiv_qrvoidmy__gmpn_tdiv_qr (mp_ptr qp, mp_ptr rp, mp_size_t qxn,mp_srcptr np, mp_size_t nn, mp_srcptr dp, mp_size_t dn){ ASSERT_ALWAYS (qxn == 0); ASSERT (nn >= 0); ASSERT (dn >= 0); ASSERT (dn == 0 || dp[dn - 1] != 0); ASSERT (! MPN_OVERLAP_P (qp, nn - dn + 1 + qxn, np, nn)); ASSERT (! MPN_OVERLAP_P (qp, nn - dn + 1 + qxn, dp, dn)); int adjust; gmp_pi1_t dinv; TMP_DECL; TMP_MARK; /* conservative tests for quotient size */ adjust = np[nn - 1] >= dp[dn - 1]; mp_ptr n2p, d2p; mp_limb_t cy; int cnt; qp[nn - dn] = 0; /* zero high quotient limb */ count_leading_zeros (cnt, dp[dn - 1]); cnt -= GMP_NAIL_BITS; d2p = TMP_ALLOC_LIMBS (dn); mpn_lshift (d2p, dp, dn, cnt); for (int i=0; i<dn; i+=1) { printf("d2p %08x/n", *( (int*) (((void*)(d2p))+(i*4)))); } n2p = TMP_ALLOC_LIMBS (nn + 1); cy = mpn_lshift (n2p, np, nn, cnt); for (int i=0; i<nn; i+=1) { printf("n2p %08x/n", *( (int*) (((void*)(n2p))+(i*4)))); } n2p[nn] = cy; nn += adjust; printf("d2p[dn-1] = %08lx/nd2p[dn-2] = %08lx/n", d2p[dn-1], d2p[dn-2]); invert_pi1 (dinv, d2p[dn - 1], d2p[dn - 2]); printf("dinv %08lx/n", dinv.inv32); my_mpn_sbpi1_div_qr (qp, n2p, nn, d2p, dn, dinv.inv32); for (int i=0; i<nn; i+=1) { printf("inside qp %08x/n", *( (int*) (((void*)(qp))+(i*4)))); } n2p[nn] = cy; mpn_rshift (rp, n2p, dn, cnt); TMP_FREE; return;}
开发者ID:ysangkok,项目名称:gmp-emscripten-tests,代码行数:58,
示例18: do_hub_intr_allocstatic hub_intr_tdo_hub_intr_alloc(devfs_handle_t dev, device_desc_t dev_desc, devfs_handle_t owner_dev, int uncond_nothread){ cpuid_t cpu = 0; int vector; hub_intr_t intr_hdl; cnodeid_t cnode; int cpuphys, slice; int nasid; iopaddr_t xtalk_addr; struct xtalk_intr_s *xtalk_info; xwidget_info_t xwidget_info; ilvl_t intr_swlevel = 0; cpu = intr_heuristic(dev, dev_desc, -1, 0, owner_dev, NULL, &vector); if (cpu == CPU_NONE) { printk("Unable to allocate interrupt for 0x%p/n", (void *)owner_dev); return(0); } cpuphys = cpu_physical_id(cpu); slice = cpu_physical_id_to_slice(cpuphys); nasid = cpu_physical_id_to_nasid(cpuphys); cnode = cpuid_to_cnodeid(cpu); if (slice) { xtalk_addr = SH_II_INT1 | GLOBAL_MMR_SPACE | ((unsigned long)nasid << 36) | (1UL << 47); } else { xtalk_addr = SH_II_INT0 | GLOBAL_MMR_SPACE | ((unsigned long)nasid << 36) | (1UL << 47); } intr_hdl = snia_kmem_alloc_node(sizeof(struct hub_intr_s), KM_NOSLEEP, cnode); ASSERT_ALWAYS(intr_hdl); xtalk_info = &intr_hdl->i_xtalk_info; xtalk_info->xi_dev = dev; xtalk_info->xi_vector = vector; xtalk_info->xi_addr = xtalk_addr; xwidget_info = xwidget_info_get(dev); if (xwidget_info) { xtalk_info->xi_target = xwidget_info_masterid_get(xwidget_info); } intr_hdl->i_swlevel = intr_swlevel; intr_hdl->i_cpuid = cpu; intr_hdl->i_bit = vector; intr_hdl->i_flags |= HUB_INTR_IS_ALLOCED; hub_device_desc_update(dev_desc, intr_swlevel, cpu); return(intr_hdl);}
开发者ID:muromec,项目名称:linux-ezxdev,代码行数:58,
示例19: Runvoid Run(){ TestRunnerThread runner; runner.start(); nitki::Thread::sleep(1000); ASSERT_ALWAYS(runner.success) runner.join();}
开发者ID:dgu123,项目名称:nitki,代码行数:10,
示例20: ThreadGetHandleHANDLE ThreadGetHandle(DWORD ThreadId){ SHARED_ACQUIRE(LockThreads); if(threadList.find(ThreadId) != threadList.end()) return threadList[ThreadId].Handle; ASSERT_ALWAYS("Trying to get handle of a thread that doesn't exist!"); return nullptr;}
开发者ID:V10git,项目名称:x64dbg,代码行数:10,
示例21: ThreadGetLastErrorDWORD ThreadGetLastError(DWORD ThreadId){ SHARED_ACQUIRE(LockThreads); if(threadList.find(ThreadId) != threadList.end()) return ThreadGetLastErrorTEB(threadList[ThreadId].ThreadLocalBase); ASSERT_ALWAYS("Trying to get last error of a thread that doesn't exist!"); return 0;}
开发者ID:V10git,项目名称:x64dbg,代码行数:10,
示例22: check_vsnprintfvoidcheck_vsnprintf (const char *want, const char *fmt, va_list ap){ char got[MAX_OUTPUT+1]; int ret, got_len, want_len; size_t bufsize; want_len = strlen (want); bufsize = -1; for (;;) { /* do 0 to 5, then want-5 to want+5 */ bufsize++; if (bufsize > 5 && bufsize < want_len-5) bufsize = want_len-5; if (bufsize > want_len + 5) break; ASSERT_ALWAYS (bufsize+1 <= sizeof (got)); got[bufsize] = '!'; ret = gmp_vsnprintf (got, bufsize, fmt, ap); got_len = MIN (MAX(1,bufsize)-1, want_len); if (got[bufsize] != '!') { printf ("gmp_vsnprintf overwrote bufsize sentinel/n"); goto error; } if (ret != want_len) { printf ("gmp_vsnprintf return value wrong/n"); goto error; } if (bufsize > 0) { if (memcmp (got, want, got_len) != 0 || got[got_len] != '/0') { printf ("gmp_vsnprintf wrong result string/n"); error: printf (" fmt |%s|/n", fmt); printf (" bufsize %u/n", bufsize); printf (" got |%s|/n", got); printf (" want |%.*s|/n", got_len, want); printf (" want full |%s|/n", want); printf (" ret %d/n", ret); printf (" want_len %d/n", want_len); abort (); } } }}
开发者ID:applesnake,项目名称:cocotron-tools-gpl3,代码行数:55,
示例23: __cyg_profile_func_entervoid__cyg_profile_func_enter (void *this_fn, void *call_site){#if 0 printf ("%24s %p %p/n", name, this_fn, call_site);#endif ASSERT_ALWAYS (ncall >= 0); ASSERT_ALWAYS (ncall <= numberof (call)); if (ncall >= numberof (call)) { printf ("__cyg_profile_func_enter: oops, call stack full, from %s/n", name); abort (); } enter_seen = 1; call[ncall].this_fn = this_fn; call[ncall].call_site = call_site; ncall++;}
开发者ID:STAR111,项目名称:GCC_parser,代码行数:20,
示例24: compute_svoidcompute_s (mpz_t s, unsigned long B1){ mpz_t acc[MAX_HEIGHT]; /* To accumulate products of prime powers */ unsigned int i, j; unsigned long pi = 2, pp, maxpp; ASSERT_ALWAYS (B1 < MAX_B1_BATCH); for (j = 0; j < MAX_HEIGHT; j++) mpz_init (acc[j]); /* sets acc[j] to 0 */ i = 0; while (pi <= B1) { pp = pi; maxpp = B1 / pi; while (pp <= maxpp) pp *= pi; if ((i & 1) == 0) mpz_set_ui (acc[0], pp); else mpz_mul_ui (acc[0], acc[0], pp); j = 0; /* We have accumulated i+1 products so far. If bits 0..j of i are all set, then i+1 is a multiple of 2^(j+1). */ while ((i & (1 << j)) != 0) { /* we use acc[MAX_HEIGHT-1] as 0-sentinel below, thus we need j+1 < MAX_HEIGHT-1 */ ASSERT (j + 1 < MAX_HEIGHT - 1); if ((i & (1 << (j + 1))) == 0) /* i+1 is not multiple of 2^(j+2), thus add[j+1] is "empty" */ mpz_swap (acc[j+1], acc[j]); /* avoid a copy with mpz_set */ else mpz_mul (acc[j+1], acc[j+1], acc[j]); /* accumulate in acc[j+1] */ mpz_set_ui (acc[j], 1); j++; } i++; pi = getprime (pi); } for (mpz_set (s, acc[0]), j = 1; mpz_cmp_ui (acc[j], 0) != 0; j++) mpz_mul (s, s, acc[j]); getprime_clear (); /* free the prime tables, and reinitialize */ for (i = 0; i < MAX_HEIGHT; i++) mpz_clear (acc[i]);}
开发者ID:CplusHua,项目名称:yafu-setup-package,代码行数:53,
示例25: mainintmain (int argc, char *argv[]){ if (argc > 1 && strcmp (argv[1], "-s") == 0) option_check_printf = 1; tests_start (); check_vfprintf_fp = fopen (CHECK_VFPRINTF_FILENAME, "w+"); ASSERT_ALWAYS (check_vfprintf_fp != NULL); check_z (); check_q (); check_f (); check_limb (); check_n (); check_misc (); ASSERT_ALWAYS (fclose (check_vfprintf_fp) == 0); unlink (CHECK_VFPRINTF_FILENAME); tests_end (); exit (0);}
开发者ID:applesnake,项目名称:cocotron-tools-gpl3,代码行数:22,
示例26: xfs_vm_faultSTATIC intxfs_vm_fault( struct vm_area_struct *vma, struct vm_fault *vmf){ struct inode *inode = vma->vm_file->f_path.dentry->d_inode; bhv_vnode_t *vp = vn_from_inode(inode); ASSERT_ALWAYS(vp->v_vfsp->vfs_flag & VFS_DMI); if (XFS_SEND_MMAP(XFS_VFSTOM(vp->v_vfsp), vma, 0)) return VM_FAULT_SIGBUS; return filemap_fault(vma, vmf);}
开发者ID:PennPanda,项目名称:linux-repo,代码行数:13,
示例27: __cyg_profile_func_exitvoid__cyg_profile_func_exit (void *this_fn, void *call_site){ ASSERT_ALWAYS (ncall >= 0); ASSERT_ALWAYS (ncall <= numberof (call)); if (ncall == 0) { printf ("__cyg_profile_func_exit: call stack empty, from %s/n", name); abort (); } ncall--; if (this_fn != call[ncall].this_fn || call_site != call[ncall].call_site) { printf ("__cyg_profile_func_exit: unbalanced this_fn/call_site from %s/n", name); printf (" this_fn got %p/n", this_fn); printf (" want %p/n", call[ncall].this_fn); printf (" call_site got %p/n", call_site); printf (" want %p/n", call[ncall].call_site); abort (); }}
开发者ID:STAR111,项目名称:GCC_parser,代码行数:23,
示例28: TestOperatorLogicalNotstatic void TestOperatorLogicalNot(){ ting::Ref<TestClass> a; ting::Ref<TestClass> b = TestClass::New(); //test operator !() if(!a){ }else{ ASSERT_ALWAYS(false) } if(!b){ ASSERT_ALWAYS(false) }}
开发者ID:liangfu,项目名称:ting,代码行数:14,
注:本文中的ASSERT_ALWAYS函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ASSERT_ARG函数代码示例 C++ ASSERTSZ函数代码示例 |