2017-09-24 1 views

答えて

4
writeln("hey ioctl, your mother is a hamster and your father smells of elderberries!"); 

nah私はちょうど冗談です。

私はprolly同じに見える偽のioctl関数を記述し、それをだましてインポートおよびバージョンを使用しているんだろうと何:

import core.sys.posix.sys.ioctl; 

version(unittest) 
int ioctl(int d, int request, ...) { 
     import std.stdio; 
     writeln("its a fake!"); 
     return 0; 
} 

void main() { 
     ioctl(0, 0); 
} 

はとし、ユニットテストなしでは異なる結果が得られることを実行している+のコンパイル。あなたのローカル関数は、実際の関数の代わりに呼び出すことができます。

関連する問題