Piotr Caban : msvcp140/tests: Test virtual base table size exports.

Alexandre Julliard julliard at winehq.org
Tue Oct 4 13:38:25 CDT 2016


Module: wine
Branch: master
Commit: ca862a3849f481e87cc2c1ed5b9b0de60526355d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ca862a3849f481e87cc2c1ed5b9b0de60526355d

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Oct  4 10:10:05 2016 +0200

msvcp140/tests: Test virtual base table size exports.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcp140/tests/msvcp140.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c
index d54ced3..82e2b34 100644
--- a/dlls/msvcp140/tests/msvcp140.c
+++ b/dlls/msvcp140/tests/msvcp140.c
@@ -47,9 +47,45 @@ static void test_thrd(void)
         p__Thrd_id(), GetCurrentThreadId());
 }
 
+static struct {
+    int value[2];
+    const char* export_name;
+} vbtable_size_exports_list[] = {
+    {{0x20, 0x20}, "??_8?$basic_iostream at DU?$char_traits at D@std@@@std@@7B?$basic_istream at DU?$char_traits at D@std@@@1@@"},
+    {{0x10, 0x10}, "??_8?$basic_iostream at DU?$char_traits at D@std@@@std@@7B?$basic_ostream at DU?$char_traits at D@std@@@1@@"},
+    {{0x20, 0x20}, "??_8?$basic_iostream at GU?$char_traits at G@std@@@std@@7B?$basic_istream at GU?$char_traits at G@std@@@1@@"},
+    {{0x10, 0x10}, "??_8?$basic_iostream at GU?$char_traits at G@std@@@std@@7B?$basic_ostream at GU?$char_traits at G@std@@@1@@"},
+    {{0x20, 0x20}, "??_8?$basic_iostream at _WU?$char_traits at _W@std@@@std@@7B?$basic_istream at _WU?$char_traits at _W@std@@@1@@"},
+    {{0x10, 0x10}, "??_8?$basic_iostream at _WU?$char_traits at _W@std@@@std@@7B?$basic_ostream at _WU?$char_traits at _W@std@@@1@@"},
+    {{0x18, 0x18}, "??_8?$basic_istream at DU?$char_traits at D@std@@@std@@7B@"},
+    {{0x18, 0x18}, "??_8?$basic_istream at GU?$char_traits at G@std@@@std@@7B@"},
+    {{0x18, 0x18}, "??_8?$basic_istream at _WU?$char_traits at _W@std@@@std@@7B@"},
+    {{ 0x8, 0x10}, "??_8?$basic_ostream at DU?$char_traits at D@std@@@std@@7B@"},
+    {{ 0x8, 0x10}, "??_8?$basic_ostream at GU?$char_traits at G@std@@@std@@7B@"},
+    {{ 0x8, 0x10}, "??_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(msvcp140)
 {
     if(!init()) return;
     test_thrd();
+    test_vbtable_size_exports();
     FreeLibrary(msvcp);
 }




More information about the wine-cvs mailing list