Multiple OS Unit Testing in one file - Is it possible?
<p>I need to do something like this:</p>

<pre><code>void Test::testUnitTest() {
#define OS_MACOSX 1
    performUnitTest();
#undef OS_MACOSX
    performUnitTest();
}

void Test::performUnitTest() {
    CefKeyEvent event;
    event.modifiers = CTRL;
    event.windows_key_code = KeyboardHander::KeyCodeC;
#ifdef OS_MACOSX
    fructose_assert(1==2);
    event.modifiers = COMMAND;
#endif
    fructose_assert(handler.get()-&gt;IsCopyRequest(event));
}
</code></pre>

<p>...</p>

<pre><code>bool RealClass::IsCopyRequest(const CefKeyEvent&amp; event) {
#ifdef OS_MACOSX
    return IsCOMMANDDown(event.modifiers) &amp;&amp; event.character == 'c';
#else
    return isCTRLDown(event.modifiers) &amp;&amp; event.character == 'c';
#endif
}
</code></pre>

<p>When <code>testUnitTest()</code> is called, the fructose_assert(1==2)in <code>performUnitTest()</code> is never called. In the actual test, it's always calling the isCTRLDown() method. Which makes sense with a preprocessor directive. Question is, how to make this actually work? </p>