小编Mys*_*fle的帖子

How are kernels (and operating systems in general) written in C?

I'm trying to understand how you set about writing an OS in something like C.

I've always used C to write applications - using commands like malloc and fork and so on to request things from the OS. If these methods don't exist when you're programming the OS itself (or perhaps the Kernel in particular), how do you write them?

How do you implement memory and process management and so on, specifically what functions are available and what is exposed …

c operating-system kernel

3
推荐指数
1
解决办法
103
查看次数

如何检查mock Mock 的构造函数参数?

我有以下代码(在 Kotlin 中):

class X {
    fun foo() {
        val A(1, true, "three")
        val b = B()
        b.bar(A)
    }
}
Run Code Online (Sandbox Code Playgroud)

我想要的是找出A已实例化的内容。

我的测试代码如下所示:

// Needed for something else
every { anyConstructed<A>().go() } returns "testString"

// What I'm using to extract A
val barSlot = slot<A>()
verify { anyConstructed<B>().bar(capture(barSlot)) }
val a = barSlot.captured
Run Code Online (Sandbox Code Playgroud)

A现在我已经成功捕获了构造时创建的模拟(感谢该语句) ,如何检查已实例化哪些值every

谢谢!

mocking kotlin mockk

3
推荐指数
1
解决办法
4515
查看次数

标签 统计

c ×1

kernel ×1

kotlin ×1

mocking ×1

mockk ×1

operating-system ×1