static void TestFormattedAssertionAtElevatedIrql() { KIRQL OldIrql; KeRaiseIrql( DISPATCH_LEVEL, &OldIrql ); CFIX_ASSERT_MESSAGE( TRUE, L"%d%s", 1, L"123" ); CFIX_ASSERT_MESSAGE( TRUE, L"test" ); KeLowerIrql( OldIrql ); }
/**------------------------------------------------------------------------------- TestOne @brief @return void ---------------------------------------------------------------------------------*/ void TestOne() { const wchar_t* testString = L"test model"; CFIX_LOG(L"Testing %s", testString); // samples CFIXCC_ASSERT_EQUALS(1, 1); CFIXCC_ASSERT_EQUALS(L"test model", testString); CFIXCC_ASSERT_EQUALS(wcslen(testString), (size_t) 10); CFIX_ASSERT(wcslen(testString) == 10); CFIX_ASSERT_MESSAGE(testString[0] == 't', "Test string should start with a 't'"); double expected[]= {0,1.000000000000000,0.500000000000000,0.750000000000000,0.625000000000000,0.687500000000000,0.656250000000000,0.671875000000000,0.664062500000000,0.667968750000000,0.666015625000000,0.666992187500000,0.666503906250000,0.666748046875000,0.666625976562500,0.666687011718750,0.666656494140625}; for (int i=0; i<17; ++i) { double out=getSystemOutput(1); CFIXCC_ASSERT_EQUALS(expected[i], out); } }
static void Nulls() { CFIX_ASSERT_MESSAGE( TRUE, NULL ); CFIX_LOG( NULL ); //CFIX_INCONCLUSIVE( NULL ); }
static void TestFormattedAssertionAtPassiveLevel() { CFIX_ASSERT_MESSAGE( TRUE, L"%d%s", 1, L"123" ); CFIX_ASSERT_MESSAGE( TRUE, L"test" ); }