Home
last modified time | relevance | path

Searched refs:assert (Results 1 – 25 of 34) sorted by relevance

12

/DragonOS-0.1.8/kernel/src/ktest/
Dtest-kfifo.c13 assert(kfifo_alloc(&fifo, fifo_size, 0) == 0); in ktest_kfifo_case0_1()
20 assert(fifo.buffer != NULL); in ktest_kfifo_case0_1()
21 assert(fifo.total_size == fifo_size); in ktest_kfifo_case0_1()
22 assert(kfifo_total_size(&fifo) == fifo_size); in ktest_kfifo_case0_1()
23 assert(fifo.size == 0); in ktest_kfifo_case0_1()
24 assert(kfifo_size(&fifo) == 0); in ktest_kfifo_case0_1()
25 assert(fifo.in_offset == 0); in ktest_kfifo_case0_1()
26 assert(fifo.out_offset == 0); in ktest_kfifo_case0_1()
27 assert(kfifo_empty(&fifo) == 1); in ktest_kfifo_case0_1()
28 assert(kfifo_full(&fifo) == 0); in ktest_kfifo_case0_1()
[all …]
Dtest-idr.c26 assert((int)(bitmap == IDR_FULL)); in ktest_idr_case0()
29 assert(k_idr.top == NULL); // 刚被创建,必须是NULL in ktest_idr_case0()
30 assert(k_idr.id_free_cnt == 0); // 必须是0 in ktest_idr_case0()
31 assert(k_idr.free_list == NULL); in ktest_idr_case0()
35 assert(k_idr.id_free_cnt == 0); in ktest_idr_case0()
37 assert(idr_preload(&k_idr, 0) == 0); in ktest_idr_case0()
38 assert(k_idr.id_free_cnt == IDR_FREE_MAX); in ktest_idr_case0()
49 assert(id == chk_id); in ktest_idr_case0()
54 assert(k_idr.id_free_cnt == 0); in ktest_idr_case0()
55 assert(k_idr.free_list == NULL); in ktest_idr_case0()
[all …]
Dtest-bitree.c44 assert(rn != NULL); in ktest_bitree_case1()
45 assert((int64_t)rn != (-EINVAL)); in ktest_bitree_case1()
46 assert(rn->value == tv1); in ktest_bitree_case1()
49 assert(tree != NULL); in ktest_bitree_case1()
50 assert(tree->bt_node == rn); in ktest_bitree_case1()
51 assert(tree->cmp == compare); in ktest_bitree_case1()
52 assert(tree->release == release); in ktest_bitree_case1()
53 assert(tree->size == 1); in ktest_bitree_case1()
57 assert(tv2 != NULL); in ktest_bitree_case1()
62 assert(val == 0); in ktest_bitree_case1()
[all …]
Dtest-mutex.c18 assert(mutex_is_locked(&mtx) == 0); in ktest_mutex_case0()
20 assert(mutex_is_locked(&mtx) == 1); in ktest_mutex_case0()
22 assert(mutex_is_locked(&mtx) == 0); in ktest_mutex_case0()
23 assert(mutex_trylock(&mtx) == 1); in ktest_mutex_case0()
25 assert(mutex_is_locked(&mtx) == 0); in ktest_mutex_case0()
37 assert(mutex_is_locked(&mtx) == 1); in ktest_mutex_case1_pid1()
39 assert(atomic_read(&mtx.count) == 0); in ktest_mutex_case1_pid1()
40 assert(list_empty(&mtx.wait_list)); in ktest_mutex_case1_pid1()
49 if (!assert(mutex_is_locked(&mtx) == 0)) in ktest_mutex_case1()
62 assert(atomic_read(&mtx.count) == 0); in ktest_mutex_case1()
[all …]
Dktest_utils.h6 #define assert(condition) ({ \ macro
/DragonOS-0.1.8/kernel/src/arch/x86_64/
Dia64_msi.c13 …(vector, processor, edge_trigger, assert) ((uint32_t)((vector & 0xff) | (edge_trigger == 1 ? 0 : (… argument
25 …msi_message_data(msi_desc->irq_num, msi_desc->processor, msi_desc->edge_trigger, msi_desc->assert); in msi_arch_get_msg()
Dfpu.rs58 assert!(core::mem::size_of::<Self>() == 512); in new()
/DragonOS-0.1.8/docs/kernel/ktest/
Dktest-framework.md51 …能测试到目标组件的每个情况。为了检验模块的行为是否符合预期,我们需要使用`assert(condition)`宏函数,对目标`condition`进行校验。若`condition`为1,则表明测试…
88 ### assert subsection
90 `#define assert(condition)`
/DragonOS-0.1.8/kernel/src/libs/
Dlz4.c245 #ifndef assert
246 #define assert(condition) ((void)0) macro
469 assert(srcPtr + offset == dstPtr); in LZ4_memcpy_using_offset_base()
519 assert(dstEnd >= dstPtr + MINMATCH); in LZ4_memcpy_using_offset()
555 assert(val != 0); in LZ4_NbCommonBytes()
954 assert(0); in LZ4_clearHash()
986 assert(0); in LZ4_putIndexOnHash()
998 assert(idx < 65536); in LZ4_putIndexOnHash()
1013 assert(0); in LZ4_putPositionOnHash()
1055 assert(h < (1U << (LZ4_MEMORY_USAGE - 2))); in LZ4_getIndexOnHash()
[all …]
Drbtree.rs1474 assert!(m.is_empty()); in test_empty_iter()
1485 assert!(m.is_empty()); in test_lots_of_insertions()
1502 assert!(!m.contains_key(&i)); in test_lots_of_insertions()
1507 assert!(m.remove(&i).is_some()); in test_lots_of_insertions()
1510 assert!(!m.contains_key(&j)); in test_lots_of_insertions()
1514 assert!(m.contains_key(&j)); in test_lots_of_insertions()
1519 assert!(!m.contains_key(&i)); in test_lots_of_insertions()
1528 assert!(m.remove(&i).is_some()); in test_lots_of_insertions()
1531 assert!(!m.contains_key(&j)); in test_lots_of_insertions()
1535 assert!(m.contains_key(&j)); in test_lots_of_insertions()
[all …]
Dprintk.rs173 assert!(s_len < 1024, "s_len is too long"); in __write_string_on_stack()
193 assert!(s_len < 1024, "s_len is too long"); in __write_string_color_on_stack()
Dlazy_init.rs69 assert!(!self.initialized()); in init()
Dmutex.rs118 assert!(inner.is_locked); in unlock()
Dalign.rs138 assert!(align != 0 && align.is_power_of_two()); in check_aligned()
Dwait_queue.rs82 assert!(CurrentIrqArch::is_irq_enabled() == false); in sleep_without_schedule()
/DragonOS-0.1.8/kernel/src/mm/allocator/
Dbuddy.rs133 assert!(paddr & ((1 << i) - 1) == 0); in new()
176 assert!(!page_list_paddr.is_null()); in new()
199 assert!(!page_list_paddr.is_null()); in new()
207 assert!(remain_bytes < (1 << MAX_ORDER - 1)); in new()
211 assert!(paddr & ((1 << i) - 1) == 0); in new()
227 assert!(remain_bytes == 0); in new()
228 assert!(paddr == initial_bump_offset + pages_to_buddy.data() * A::PAGE_SIZE); in new()
304 assert!(!next_page_list_addr.is_null()); in pop_front()
408 assert!(count.data().is_power_of_two()); in buddy_alloc()
485 assert!( in buddy_free()
[all …]
/DragonOS-0.1.8/kernel/src/mm/
Dsyscall.rs171 assert!(start_vaddr.check_aligned(MMArch::PAGE_SIZE)); in munmap()
172 assert!(check_aligned(len, MMArch::PAGE_SIZE)); in munmap()
204 assert!(start_vaddr.check_aligned(MMArch::PAGE_SIZE)); in mprotect()
205 assert!(check_aligned(len, MMArch::PAGE_SIZE)); in mprotect()
Dno_init.rs58 assert!(vaddr.check_aligned(MMArch::PAGE_SIZE)); in pseudo_map_phys()
59 assert!(paddr.check_aligned(MMArch::PAGE_SIZE)); in pseudo_map_phys()
Dc_adapter.rs51 assert!(kernel_mapper.is_some()); in rs_map_phys()
90 assert!(space.len() == size); in do_kmalloc()
Dpercpu.rs32 assert!(cpus > 0, "PerCpu::init(): smp_get_total_cpu() returned 0"); in init()
Ducontext.rs472 assert!(self.user_stack.is_none(), "User stack already exists"); in new_user_stack()
501 assert!(new_brk.check_aligned(MMArch::PAGE_SIZE)); in set_brk()
745 assert!(self.conflicts(region).next().is_none()); in insert_vma()
829 assert!(guard.mapped); in remap()
848 assert!(guard.mapped); in unmap()
885 assert!(region.start().check_aligned(MMArch::PAGE_SIZE)); in extract()
886 assert!(region.end().check_aligned(MMArch::PAGE_SIZE)); in extract()
993 assert!(self.mapped); in remap()
1139 assert!(!self.mapped, "VMA is still mapped"); in drop()
1188 assert!(stack_bottom.check_aligned(MMArch::PAGE_SIZE)); in new()
/DragonOS-0.1.8/kernel/src/arch/x86_64/mm/
Dmod.rs465 assert!(allocated_frame_count.data().is_power_of_two()); in test_buddy()
466 assert!(paddr.data() % MMArch::PAGE_SIZE == 0); in test_buddy()
468 assert!(MMArch::phys_2_virt(paddr) in test_buddy()
475 assert!(addr_set.insert(paddr), "duplicate address: {:?}", paddr); in test_buddy()
500 assert!(addr_set.remove(&paddr)); in test_buddy()
517 assert!(addr_set.remove(&paddr)); in test_buddy()
545 assert!(count.data().is_power_of_two()); in free()
610 assert!(mapper.as_mut().is_some()); in unmap_at_low_address()
/DragonOS-0.1.8/kernel/src/driver/pci/
Dmsi.h76 uint16_t assert; // 是否高电平触发 member
/DragonOS-0.1.8/docs/kernel/locking/
Dspinlock.md66 assert!(g.as_slice() == [1, 2, 2] || g.as_slice() == [2, 2, 1]);
Dmutex.md60 assert!(g.as_slice() == [1, 2, 2] || g.as_slice() == [2, 2, 1]);

12