Content

Not quite a Yegge long.

File: Code

2008-11-04 :: admin // Code
Mock Objects for C++, Part 3

This is part 3 of an ongoing series on implementing automatic mock object support for C++, by breaking pretty much every rule in the book. In Part 1, we made fake vtables, which we could manipulate however we pleased, and callers were none the wiser. In Part 2, we pulled apart the virtual dispatch code [...]

1 comment  » Read the rest

2008-11-04 :: admin // Code
Mock Objects for C++, Part 2

Last time, we looked at how vtables work, and how we can fake them to implement interfaces at runtime. Now we need to figure out how to wire up a fake vtable that actually does what we want, based on expectations the user declares. Here’s an example of where we’re going. It should be somewhat [...]

1 comment  » Read the rest

2008-11-04 :: admin // Code
Mock Objects for C++, Part 1

Executive summary: First part of a series (with source code) on automatically creating mock objects against interfaces in C++. Get the library here (works with Visual C++ 2005/2008). This has been tested and used successfully in a project for one of my clients. If you’re curious as to how this works, I’ll explain over the [...]

3 comments  » Read the rest

The short version: Yes, it’s possible. We just did it. You can get the patch here: Source code (1337 bytes) Compiled patch (52K) To apply the patch, just run it in the same folder that contains iw3mp.exe. On Vista, you’ll need run it as administrator to do this. Note that if you want to play [...]

13 comments  » Read the rest