msvcp100/tests: Test virtual base table size exports.

Bernhard Übelacker bernhardu at vr-web.de
Wed Jan 13 15:54:29 CST 2016


Related to:
- https://bugs.winehq.org/show_bug.cgi?id=39034 (closed)
- 6d22a3a4764d2e3247b26c875ff27ee2963e7220 msvcp120: Fix layout of classes with vtordisp field.
- 91ddd1d8b2b3164bffe1b4a7ddf2c485dd7a3879 msvcp120/tests: Test virtual base table size exports.
- 367b30d8278684aaff373f5666b78264137d7a8f msvcp120: Add vtordisp field to classes with virtual base.
- ba35b96e0e72c009942f5cede40a1957d952c0b8 msvcp120: Add _Add_vtordisp virtual functions to basic_ios class.

Signed-off-by: Bernhard Übelacker <bernhardu at vr-web.de>
---
 dlls/msvcp100/tests/misc.c | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/dlls/msvcp100/tests/misc.c b/dlls/msvcp100/tests/misc.c
index 7775888..4740951 100644
--- a/dlls/msvcp100/tests/misc.c
+++ b/dlls/msvcp100/tests/misc.c
@@ -195,6 +195,41 @@ static void test__Container_base12(void)
     ok(p2.head == (void*)0xdeadbeef, "p2.head = %p, expected 0xdeadbeef\n", p2.head);
 }
 
+static struct {
+    int value[2];
+    const char* export_name;
+} vbtable_size_exports_list[] = {
+    {{0x18, 0x18}, "??_8?$basic_iostream at DU?$char_traits at D@std@@@std@@7B?$basic_istream at DU?$char_traits at D@std@@@1@@"},
+    {{ 0x8,  0x8}, "??_8?$basic_iostream at DU?$char_traits at D@std@@@std@@7B?$basic_ostream at DU?$char_traits at D@std@@@1@@"},
+    {{0x18, 0x18}, "??_8?$basic_iostream at GU?$char_traits at G@std@@@std@@7B?$basic_istream at GU?$char_traits at G@std@@@1@@"},
+    {{ 0x8,  0x8}, "??_8?$basic_iostream at GU?$char_traits at G@std@@@std@@7B?$basic_ostream at GU?$char_traits at G@std@@@1@@"},
+    {{0x18, 0x18}, "??_8?$basic_iostream at _WU?$char_traits at _W@std@@@std@@7B?$basic_istream at _WU?$char_traits at _W@std@@@1@@"},
+    {{ 0x8,  0x8}, "??_8?$basic_iostream at _WU?$char_traits at _W@std@@@std@@7B?$basic_ostream at _WU?$char_traits at _W@std@@@1@@"},
+    {{0x10, 0x10}, "??_8?$basic_istream at DU?$char_traits at D@std@@@std@@7B@"},
+    {{0x10, 0x10}, "??_8?$basic_istream at GU?$char_traits at G@std@@@std@@7B@"},
+    {{0x10, 0x10}, "??_8?$basic_istream at _WU?$char_traits at _W@std@@@std@@7B@"},
+    {{ 0x8,  0x8}, "??_8?$basic_ostream at DU?$char_traits at D@std@@@std@@7B@"},
+    {{ 0x8,  0x8}, "??_8?$basic_ostream at GU?$char_traits at G@std@@@std@@7B@"},
+    {{ 0x8,  0x8}, "??_8?$basic_ostream at _WU?$char_traits at _W@std@@@std@@7B@"},
+    {{ 0x0,  0x0}, 0}
+};
+
+static void test_vbtable_size_exports(void)
+{
+    int i;
+    const int *p_vbtable;
+    int arch_idx = (sizeof(void*) == 8);
+
+    for (i = 0; vbtable_size_exports_list[i].export_name; i++)
+    {
+        SET(p_vbtable, vbtable_size_exports_list[i].export_name);
+
+        ok(p_vbtable[0] == 0, "vbtable[0] wrong, got 0x%x\n", p_vbtable[0]);
+        ok(p_vbtable[1] == vbtable_size_exports_list[i].value[arch_idx],
+                "%d: %s[1] wrong, got 0x%x\n", i, vbtable_size_exports_list[i].export_name, p_vbtable[1]);
+    }
+}
+
 START_TEST(misc)
 {
     if(!init())
@@ -202,5 +237,7 @@ START_TEST(misc)
 
     test__Container_base12();
 
+    test_vbtable_size_exports();
+
     FreeLibrary(msvcp);
 }
-- 
2.1.4




More information about the wine-patches mailing list