unit_tests are failing under 32 bit mingw-w64 fix #905

This commit is contained in:
rusefi 2019-08-25 17:38:08 -04:00
parent c3562bde51
commit f816e92671
2 changed files with 10 additions and 2 deletions

View File

@ -47,7 +47,7 @@ GTEST_API_ int main(int argc, char **argv) {
// printTriggerDebug = true;
// resizeMap();
printf("Success 20190824\r\n");
printf("Success 20190825\r\n");
printAllTriggers();
// printConvertedTable();
testing::InitGoogleTest(&argc, argv);

View File

@ -53,11 +53,19 @@ TEST(misc, cppPlainStructMemoryLayout) {
ASSERT_EQ(0, (int)&c.field0 - (int)&c);
}
static int valueWePointAt;
TEST(misc, cppVirtualStructMemoryLayout) {
TestChildWithVirtual c;
int * valuePointer = &valueWePointAt;
int pointerSize = sizeof(valuePointer);
// '4' in case of 32 bit target
// '8' in case of 64 bit target
// this '8' is totally compiler and platform dependent
#define MAGIC_VTABLE_SIZE 8
int MAGIC_VTABLE_SIZE = pointerSize;
// validate field initializers just for fun
ASSERT_EQ(540, c.field0);