[Development] date/time adjust for (auto) testing

Bo Thorsen bo at vikingsoft.eu
Wed Jun 3 12:42:30 CEST 2015


Den 03-06-2015 kl. 12:26 skrev André Somers:
>> If you really want to modify the output of current...() then you might
>> >consider preloading a library over Qt that does it for you.
>> >
> I am considering that option as well, but that would require me to hook
> into the windows kernel calls. Like I said, that approach is much
> trickier and have a bigger chance of having side effects on for instance
> Squish.

No, I meant preloading over the QDateTime::currentDateTime function. You 
can load a dll that replaces specific functions in another dll, which 
means you can replace any Qt method you want to. Or at least that's 
possible in theory. I've never actually done it on windows.

I can perfectly understand you don't want to mess with windows kernel 
hooks. But doing dll injection on Qt itself might be okay for running 
your unit tests.

On linux you can do this with LD_PRELOAD as well.

Bo Thorsen,
Director, Viking Software.

-- 
Viking Software
Qt and C++ developers for hire
http://www.vikingsoft.eu



More information about the Development mailing list