winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2016
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
592 discussions
Start a n
N
ew thread
Francois Gouget : wined3d: Make glsl_vertex_pipe_clip_plane() static.
by Alexandre Julliard
15 Jun '16
15 Jun '16
Module: wine Branch: master Commit: 0652bf7eca6b7de9315b7be37c062bcee6eef388 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0652bf7eca6b7de9315b7be37…
Author: Francois Gouget <fgouget(a)free.fr> Date: Sat Jun 11 13:53:27 2016 +0200 wined3d: Make glsl_vertex_pipe_clip_plane() static. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/glsl_shader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 55affc1..719c8a2 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -9062,7 +9062,7 @@ static void glsl_vertex_pipe_shademode(struct wined3d_context *context, context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_VERTEX; } -void glsl_vertex_pipe_clip_plane(struct wined3d_context *context, +static void glsl_vertex_pipe_clip_plane(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_gl_info *gl_info = context->gl_info;
1
0
0
0
Béla Gyebrószki : wined3d: Add Nvidia GeForce GT 730 (GK208).
by Alexandre Julliard
15 Jun '16
15 Jun '16
Module: wine Branch: master Commit: 72cdfff3e5b8dafbe71ad353f442bc8c67be568d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=72cdfff3e5b8dafbe71ad353f…
Author: Béla Gyebrószki <gyebro69(a)gmail.com> Date: Fri Jun 10 20:15:11 2016 +0200 wined3d: Add Nvidia GeForce GT 730 (GK208). Signed-off-by: Béla Gyebrószki <gyebro69(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/directx.c | 2 ++ dlls/wined3d/wined3d_private.h | 1 + 2 files changed, 3 insertions(+) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 48feeef..4fc7736 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1279,6 +1279,7 @@ static const struct gpu_description gpu_description_table[] = {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX670, "NVIDIA GeForce GTX 670", DRIVER_NVIDIA_GEFORCE8, 2048}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX670MX, "NVIDIA GeForce GTX 670MX", DRIVER_NVIDIA_GEFORCE8, 3072}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX680, "NVIDIA GeForce GTX 680", DRIVER_NVIDIA_GEFORCE8, 2048}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT730, "NVIDIA GeForce GT 730", DRIVER_NVIDIA_GEFORCE8, 2048}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT730M, "NVIDIA GeForce GT 730M", DRIVER_NVIDIA_GEFORCE8, 1024}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT750M, "NVIDIA GeForce GT 750M", DRIVER_NVIDIA_GEFORCE8, 1024}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX750, "NVIDIA GeForce GTX 750", DRIVER_NVIDIA_GEFORCE8, 1024}, @@ -1788,6 +1789,7 @@ cards_nvidia_binary[] = {"GTX 750", CARD_NVIDIA_GEFORCE_GTX750}, /* Geforce 700 - midend */ {"GT 750M", CARD_NVIDIA_GEFORCE_GT750M}, /* Geforce 700 - midend mobile */ {"GT 730M", CARD_NVIDIA_GEFORCE_GT730M}, /* Geforce 700 - midend mobile */ + {"GT 730", CARD_NVIDIA_GEFORCE_GT730}, /* Geforce 700 - lowend */ {"GTX 680", CARD_NVIDIA_GEFORCE_GTX680}, /* Geforce 600 - highend */ {"GTX 670MX", CARD_NVIDIA_GEFORCE_GTX670MX}, /* Geforce 600 - highend */ {"GTX 670", CARD_NVIDIA_GEFORCE_GTX670}, /* Geforce 600 - midend high */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 7207523..ffcfb81 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1821,6 +1821,7 @@ enum wined3d_pci_device CARD_NVIDIA_GEFORCE_GTX670 = 0x1189, CARD_NVIDIA_GEFORCE_GTX670MX = 0x11a1, CARD_NVIDIA_GEFORCE_GTX680 = 0x1180, + CARD_NVIDIA_GEFORCE_GT730 = 0x1287, CARD_NVIDIA_GEFORCE_GT730M = 0x0fe1, CARD_NVIDIA_GEFORCE_GT750M = 0x0fe9, CARD_NVIDIA_GEFORCE_GTX750 = 0x1381,
1
0
0
0
Iván Matellanes : msvcirt: Implement ostream:: writepad.
by Alexandre Julliard
15 Jun '16
15 Jun '16
Module: wine Branch: master Commit: d5f445511e57611c83b85e241e939b3ca7e598a2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d5f445511e57611c83b85e241…
Author: Iván Matellanes <matellanesivan(a)gmail.com> Date: Tue Jun 14 15:40:24 2016 +0100 msvcirt: Implement ostream::writepad. Signed-off-by: Iván Matellanes <matellanes.ivan(a)gmail.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcirt/msvcirt.c | 26 +++++++++++++- dlls/msvcirt/tests/msvcirt.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 1 deletion(-) diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c index 0879a1d..fe5901a 100644 --- a/dlls/msvcirt/msvcirt.c +++ b/dlls/msvcirt/msvcirt.c @@ -2561,7 +2561,31 @@ ostream* __thiscall ostream_write_unsigned_char(ostream *this, const unsigned ch DEFINE_THISCALL_WRAPPER(ostream_writepad, 12) ostream* __thiscall ostream_writepad(ostream *this, const char *str1, const char *str2) { - FIXME("(%p %s %s) stub\n", this, str1, str2); + ios *base = ostream_get_ios(this); + int len1 = strlen(str1), len2 = strlen(str2), i; + + TRACE("(%p %p %p)\n", this, str1, str2); + + /* left of the padding */ + if (base->flags & (FLAGS_left|FLAGS_internal)) { + if (streambuf_sputn(base->sb, str1, len1) != len1) + ios_clear(base, base->state | IOSTATE_failbit | IOSTATE_badbit); + if (!(base->flags & FLAGS_internal)) + if (streambuf_sputn(base->sb, str2, len2) != len2) + ios_clear(base, base->state | IOSTATE_failbit | IOSTATE_badbit); + } + /* add padding to fill the width */ + for (i = len1 + len2; i < base->width; i++) + if (streambuf_sputc(base->sb, base->fill) == EOF) + ios_clear(base, base->state | IOSTATE_failbit | IOSTATE_badbit); + /* right of the padding */ + if ((base->flags & (FLAGS_left|FLAGS_internal)) != FLAGS_left) { + if (!(base->flags & (FLAGS_left|FLAGS_internal))) + if (streambuf_sputn(base->sb, str1, len1) != len1) + ios_clear(base, base->state | IOSTATE_failbit | IOSTATE_badbit); + if (streambuf_sputn(base->sb, str2, len2) != len2) + ios_clear(base, base->state | IOSTATE_failbit | IOSTATE_badbit); + } return this; } diff --git a/dlls/msvcirt/tests/msvcirt.c b/dlls/msvcirt/tests/msvcirt.c index baabd65..a6916c1 100644 --- a/dlls/msvcirt/tests/msvcirt.c +++ b/dlls/msvcirt/tests/msvcirt.c @@ -269,6 +269,7 @@ static ostream* (*__thiscall p_ostream_write_char)(ostream*, const char*, int); static ostream* (*__thiscall p_ostream_seekp_offset)(ostream*, streamoff, ios_seek_dir); static ostream* (*__thiscall p_ostream_seekp)(ostream*, streampos); static streampos (*__thiscall p_ostream_tellp)(ostream*); +static ostream* (*__thiscall p_ostream_writepad)(ostream*, const char*, const char*); /* Emulate a __thiscall */ #ifdef __i386__ @@ -442,6 +443,7 @@ static BOOL init(void) SET(p_ostream_seekp_offset, "?seekp@ostream@@QEAAAEAV1@JW4seek_dir@ios@@@Z"); SET(p_ostream_seekp, "?seekp@ostream@@QEAAAEAV1@J@Z"); SET(p_ostream_tellp, "?tellp@ostream@@QEAAJXZ"); + SET(p_ostream_writepad, "?writepad@ostream@@AEAAAEAV1@PEBD0@Z"); } else { p_operator_new = (void*)GetProcAddress(msvcrt, "??2@YAPAXI@Z"); p_operator_delete = (void*)GetProcAddress(msvcrt, "??3@YAXPAX@Z"); @@ -545,6 +547,7 @@ static BOOL init(void) SET(p_ostream_seekp_offset, "?seekp@ostream@@QAEAAV1@JW4seek_dir@ios@@@Z"); SET(p_ostream_seekp, "?seekp@ostream@@QAEAAV1@J@Z"); SET(p_ostream_tellp, "?tellp@ostream@@QAEJXZ"); + SET(p_ostream_writepad, "?writepad@ostream@@AAEAAV1@PBD0@Z"); } SET(p_ios_static_lock, "?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A"); SET(p_ios_lockc, "?lockc@ios@@KAXXZ"); @@ -2883,6 +2886,86 @@ if (0) /* crashes on native */ IOSTATE_eofbit|IOSTATE_failbit, os1.base_ios.state); fb1.fd = fd; + /* writepad */ + os1.base_ios.state = IOSTATE_eofbit; + os1.base_ios.flags = + FLAGS_right|FLAGS_hex|FLAGS_showbase|FLAGS_showpoint|FLAGS_showpos|FLAGS_uppercase|FLAGS_fixed; + os1.base_ios.fill = 'z'; + os1.base_ios.width = 9; + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "a", "b"); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(!strncmp(fb1.base.pptr - 9, "zzzzzzzab", 9), "expected 'zzzzzzzab' got '%s'\n", fb1.base.pptr - 9); + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "aa", "bb"); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(!strncmp(fb1.base.pptr - 9, "zzzzzaabb", 9), "expected 'zzzzzaabb' got '%s'\n", fb1.base.pptr - 9); + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "aaaaa", "bbbbb"); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(!strncmp(fb1.base.pptr - 10, "aaaaabbbbb", 10), "expected 'aaaaabbbbb' got '%s'\n", fb1.base.pptr - 10); + os1.base_ios.flags |= FLAGS_internal; + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "aa", "bb"); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(!strncmp(fb1.base.pptr - 9, "aazzzzzbb", 9), "expected 'aazzzzzbb' got '%s'\n", fb1.base.pptr - 9); + os1.base_ios.flags &= ~FLAGS_right; + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "a", "b"); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(!strncmp(fb1.base.pptr - 9, "azzzzzzzb", 9), "expected 'azzzzzzzb' got '%s'\n", fb1.base.pptr - 9); + os1.base_ios.width = 6; + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "1", "2"); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(!strncmp(fb1.base.pptr - 6, "1zzzz2", 6), "expected '1zzzz2' got '%s'\n", fb1.base.pptr - 6); + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "12345678", ""); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(!strncmp(fb1.base.pptr - 8, "12345678", 8), "expected '12345678' got '%s'\n", fb1.base.pptr - 8); + os1.base_ios.flags |= FLAGS_left; + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "z1", "2z"); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(!strncmp(fb1.base.pptr - 6, "z1zz2z", 6), "expected 'z1zz2z' got '%s'\n", fb1.base.pptr - 6); + os1.base_ios.flags &= ~FLAGS_internal; + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "hell", "o"); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(!strncmp(fb1.base.pptr - 6, "helloz", 6), "expected 'helloz' got '%s'\n", fb1.base.pptr - 6); + os1.base_ios.flags |= FLAGS_right; + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "a", "b"); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(!strncmp(fb1.base.pptr - 6, "abzzzz", 6), "expected 'abzzzz' got '%s'\n", fb1.base.pptr - 6); +if (0) /* crashes on native */ + pos = (ostream*) call_func3(p_ostream_writepad, &os1, NULL, "o"); + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "", "hello"); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(!strncmp(fb1.base.pptr - 6, "helloz", 6), "expected 'helloz' got '%s'\n", fb1.base.pptr - 6); + os1.base_ios.fill = '*'; + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "", ""); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(!strncmp(fb1.base.pptr - 6, "******", 6), "expected '******' got '%s'\n", fb1.base.pptr - 6); + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "aa", ""); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(!strncmp(fb1.base.pptr - 6, "aa****", 6), "expected 'aa****' got '%s'\n", fb1.base.pptr - 6); + os1.base_ios.flags = 0; + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "a", "b"); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(!strncmp(fb1.base.pptr - 6, "****ab", 6), "expected '****ab' got '%s'\n", fb1.base.pptr - 6); + call_func1(p_filebuf_sync, &fb1); + fb1.fd = -1; + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "aa", "bb"); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == (IOSTATE_badbit|IOSTATE_failbit|IOSTATE_eofbit), "expected %d got %d\n", + IOSTATE_badbit|IOSTATE_failbit|IOSTATE_eofbit, os1.base_ios.state); + os1.base_ios.state = IOSTATE_goodbit; + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "", ""); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == (IOSTATE_badbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_badbit|IOSTATE_failbit, os1.base_ios.state); + os1.base_ios.state = IOSTATE_goodbit; + os1.base_ios.width = 0; + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "", ""); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == IOSTATE_goodbit, "expected %d got %d\n", IOSTATE_goodbit, os1.base_ios.state); + pos = (ostream*) call_func3(p_ostream_writepad, &os1, "a", ""); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == (IOSTATE_badbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_badbit|IOSTATE_failbit, os1.base_ios.state); + fb1.fd = fd; + call_func1(p_ostream_vbase_dtor, &os1); call_func1(p_ostream_vbase_dtor, &os2); call_func1(p_filebuf_dtor, &fb1);
1
0
0
0
Iván Matellanes : msvcirt: Implement ostream::tellp.
by Alexandre Julliard
15 Jun '16
15 Jun '16
Module: wine Branch: master Commit: 3f32455f01aaefb50ccb323ddbdd5974f533f253 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3f32455f01aaefb50ccb323dd…
Author: Iván Matellanes <matellanesivan(a)gmail.com> Date: Tue Jun 14 15:40:23 2016 +0100 msvcirt: Implement ostream::tellp. Signed-off-by: Iván Matellanes <matellanes.ivan(a)gmail.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcirt/msvcirt.c | 12 ++++++++++-- dlls/msvcirt/tests/msvcirt.c | 27 +++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c index 2464d4f..0879a1d 100644 --- a/dlls/msvcirt/msvcirt.c +++ b/dlls/msvcirt/msvcirt.c @@ -2511,8 +2511,16 @@ ostream* __thiscall ostream_seekp_offset(ostream *this, streamoff off, ios_seek_ DEFINE_THISCALL_WRAPPER(ostream_tellp, 4) streampos __thiscall ostream_tellp(ostream *this) { - FIXME("(%p) stub\n", this); - return 0; + ios *base = ostream_get_ios(this); + streampos pos; + + TRACE("(%p)\n", this); + + ios_lockbuf(base); + if ((pos = call_streambuf_seekoff(base->sb, 0, SEEKDIR_cur, OPENMODE_out)) == EOF) + ios_clear(base, base->state | IOSTATE_failbit); + ios_unlockbuf(base); + return pos; } /* ?write@ostream@@QAEAAV1@PBDH@Z */ diff --git a/dlls/msvcirt/tests/msvcirt.c b/dlls/msvcirt/tests/msvcirt.c index 3a6cb6e..baabd65 100644 --- a/dlls/msvcirt/tests/msvcirt.c +++ b/dlls/msvcirt/tests/msvcirt.c @@ -268,6 +268,7 @@ static ostream* (*__thiscall p_ostream_put_char)(ostream*, char); static ostream* (*__thiscall p_ostream_write_char)(ostream*, const char*, int); static ostream* (*__thiscall p_ostream_seekp_offset)(ostream*, streamoff, ios_seek_dir); static ostream* (*__thiscall p_ostream_seekp)(ostream*, streampos); +static streampos (*__thiscall p_ostream_tellp)(ostream*); /* Emulate a __thiscall */ #ifdef __i386__ @@ -440,6 +441,7 @@ static BOOL init(void) SET(p_ostream_write_char, "?write@ostream@@QEAAAEAV1@PEBDH@Z"); SET(p_ostream_seekp_offset, "?seekp@ostream@@QEAAAEAV1@JW4seek_dir@ios@@@Z"); SET(p_ostream_seekp, "?seekp@ostream@@QEAAAEAV1@J@Z"); + SET(p_ostream_tellp, "?tellp@ostream@@QEAAJXZ"); } else { p_operator_new = (void*)GetProcAddress(msvcrt, "??2@YAPAXI@Z"); p_operator_delete = (void*)GetProcAddress(msvcrt, "??3@YAXPAX@Z"); @@ -542,6 +544,7 @@ static BOOL init(void) SET(p_ostream_write_char, "?write@ostream@@QAEAAV1@PBDH@Z"); SET(p_ostream_seekp_offset, "?seekp@ostream@@QAEAAV1@JW4seek_dir@ios@@@Z"); SET(p_ostream_seekp, "?seekp@ostream@@QAEAAV1@J@Z"); + SET(p_ostream_tellp, "?tellp@ostream@@QAEJXZ"); } SET(p_ios_static_lock, "?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A"); SET(p_ios_lockc, "?lockc@ios@@KAXXZ"); @@ -2856,6 +2859,30 @@ if (0) /* crashes on native */ ok(os1.base_ios.state == (IOSTATE_badbit|IOSTATE_failbit), "expected %d got %d\n", IOSTATE_badbit|IOSTATE_failbit, os1.base_ios.state); + /* tellp */ + ret = (int) call_func1(p_ostream_tellp, &os1); + ok(ret == 0, "wrong return, expected 0 got %d\n", ret); + ok(os1.base_ios.state == (IOSTATE_badbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_badbit|IOSTATE_failbit, os1.base_ios.state); + ret = (int) call_func3(p_streambuf_xsputn, &fb1.base, "to say it", 9); + ok(ret == 9, "expected 9 got %d\n", ret); + ok(fb1.base.pbase == fb1.base.base, "wrong put base, expected %p got %p\n", fb1.base.base, fb1.base.pbase); + ok(fb1.base.pptr == fb1.base.base + 9, "wrong put pointer, expected %p got %p\n", fb1.base.base + 9, fb1.base.pptr); + ret = (int) call_func1(p_ostream_tellp, &os1); + ok(ret == 9, "wrong return, expected 9 got %d\n", ret); + ok(os1.base_ios.state == (IOSTATE_badbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_badbit|IOSTATE_failbit, os1.base_ios.state); + ok(fb1.base.pbase == NULL, "wrong put base, expected %p got %p\n", NULL, fb1.base.pbase); + ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); + os1.base_ios.state = IOSTATE_eofbit; + fd = fb1.fd; + fb1.fd = -1; + ret = (int) call_func1(p_ostream_tellp, &os1); + ok(ret == EOF, "wrong return, expected EOF got %d\n", ret); + ok(os1.base_ios.state == (IOSTATE_eofbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_eofbit|IOSTATE_failbit, os1.base_ios.state); + fb1.fd = fd; + call_func1(p_ostream_vbase_dtor, &os1); call_func1(p_ostream_vbase_dtor, &os2); call_func1(p_filebuf_dtor, &fb1);
1
0
0
0
Iván Matellanes : msvcirt: Implement ostream::seekp.
by Alexandre Julliard
15 Jun '16
15 Jun '16
Module: wine Branch: master Commit: d77342ff96639d988b5f606f3882e7f34261be7d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d77342ff96639d988b5f606f3…
Author: Iván Matellanes <matellanesivan(a)gmail.com> Date: Tue Jun 14 15:40:22 2016 +0100 msvcirt: Implement ostream::seekp. Signed-off-by: Iván Matellanes <matellanes.ivan(a)gmail.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcirt/msvcirt.c | 18 ++++++++++++++++-- dlls/msvcirt/tests/msvcirt.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c index 9cb7a5c..2464d4f 100644 --- a/dlls/msvcirt/msvcirt.c +++ b/dlls/msvcirt/msvcirt.c @@ -2479,7 +2479,14 @@ ostream* __thiscall ostream_put_unsigned_char(ostream *this, unsigned char c) DEFINE_THISCALL_WRAPPER(ostream_seekp, 8) ostream* __thiscall ostream_seekp(ostream *this, streampos pos) { - FIXME("(%p %d) stub\n", this, pos); + ios *base = ostream_get_ios(this); + + TRACE("(%p %d)\n", this, pos); + + ios_lockbuf(base); + if (streambuf_seekpos(base->sb, pos, OPENMODE_out) == EOF) + ios_clear(base, base->state | IOSTATE_failbit); + ios_unlockbuf(base); return this; } @@ -2488,7 +2495,14 @@ ostream* __thiscall ostream_seekp(ostream *this, streampos pos) DEFINE_THISCALL_WRAPPER(ostream_seekp_offset, 12) ostream* __thiscall ostream_seekp_offset(ostream *this, streamoff off, ios_seek_dir dir) { - FIXME("(%p %d %d) stub\n", this, off, dir); + ios *base = ostream_get_ios(this); + + TRACE("(%p %d %d)\n", this, off, dir); + + ios_lockbuf(base); + if (call_streambuf_seekoff(base->sb, off, dir, OPENMODE_out) == EOF) + ios_clear(base, base->state | IOSTATE_failbit); + ios_unlockbuf(base); return this; } diff --git a/dlls/msvcirt/tests/msvcirt.c b/dlls/msvcirt/tests/msvcirt.c index 0563046..3a6cb6e 100644 --- a/dlls/msvcirt/tests/msvcirt.c +++ b/dlls/msvcirt/tests/msvcirt.c @@ -266,6 +266,8 @@ static int (*__thiscall p_ostream_opfx)(ostream*); static void (*__thiscall p_ostream_osfx)(ostream*); static ostream* (*__thiscall p_ostream_put_char)(ostream*, char); static ostream* (*__thiscall p_ostream_write_char)(ostream*, const char*, int); +static ostream* (*__thiscall p_ostream_seekp_offset)(ostream*, streamoff, ios_seek_dir); +static ostream* (*__thiscall p_ostream_seekp)(ostream*, streampos); /* Emulate a __thiscall */ #ifdef __i386__ @@ -436,6 +438,8 @@ static BOOL init(void) SET(p_ostream_osfx, "?osfx@ostream@@QEAAXXZ"); SET(p_ostream_put_char, "?put@ostream@@QEAAAEAV1@D@Z"); SET(p_ostream_write_char, "?write@ostream@@QEAAAEAV1@PEBDH@Z"); + SET(p_ostream_seekp_offset, "?seekp@ostream@@QEAAAEAV1@JW4seek_dir@ios@@@Z"); + SET(p_ostream_seekp, "?seekp@ostream@@QEAAAEAV1@J@Z"); } else { p_operator_new = (void*)GetProcAddress(msvcrt, "??2@YAPAXI@Z"); p_operator_delete = (void*)GetProcAddress(msvcrt, "??3@YAXPAX@Z"); @@ -536,6 +540,8 @@ static BOOL init(void) SET(p_ostream_osfx, "?osfx@ostream@@QAEXXZ"); SET(p_ostream_put_char, "?put@ostream@@QAEAAV1@D@Z"); SET(p_ostream_write_char, "?write@ostream@@QAEAAV1@PBDH@Z"); + SET(p_ostream_seekp_offset, "?seekp@ostream@@QAEAAV1@JW4seek_dir@ios@@@Z"); + SET(p_ostream_seekp, "?seekp@ostream@@QAEAAV1@J@Z"); } SET(p_ios_static_lock, "?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A"); SET(p_ios_lockc, "?lockc@ios@@KAXXZ"); @@ -2816,6 +2822,40 @@ if (0) /* crashes on native */ ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); fb1.fd = fd; + /* seekp */ + os1.base_ios.state = IOSTATE_eofbit; + pos = (ostream*) call_func3(p_ostream_seekp_offset, &os1, 0, SEEKDIR_beg); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == IOSTATE_eofbit, "expected %d got %d\n", IOSTATE_eofbit, os1.base_ios.state); + ret = (int) call_func3(p_streambuf_xsputn, &fb1.base, "but", 3); + ok(ret == 3, "expected 3 got %d\n", ret); + ok(fb1.base.pbase == fb1.base.base, "wrong put base, expected %p got %p\n", fb1.base.base, fb1.base.pbase); + ok(fb1.base.pptr == fb1.base.base + 3, "wrong put pointer, expected %p got %p\n", fb1.base.base + 3, fb1.base.pptr); + pos = (ostream*) call_func3(p_ostream_seekp_offset, &os1, 0, SEEKDIR_end); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == IOSTATE_eofbit, "expected %d got %d\n", IOSTATE_eofbit, os1.base_ios.state); + ok(fb1.base.pbase == NULL, "wrong put base, expected %p got %p\n", NULL, fb1.base.pbase); + ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); + pos = (ostream*) call_func3(p_ostream_seekp_offset, &os1, -1, SEEKDIR_beg); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == (IOSTATE_eofbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_eofbit|IOSTATE_failbit, os1.base_ios.state); + ret = (int) call_func3(p_streambuf_xsputn, &fb1.base, "You're too shy", 14); + ok(ret == 14, "expected 14 got %d\n", ret); + ok(fb1.base.pbase == fb1.base.base, "wrong put base, expected %p got %p\n", fb1.base.base, fb1.base.pbase); + ok(fb1.base.pptr == fb1.base.base + 14, "wrong put pointer, expected %p got %p\n", fb1.base.base + 14, fb1.base.pptr); + pos = (ostream*) call_func2(p_ostream_seekp, &os1, 0); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == (IOSTATE_eofbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_eofbit|IOSTATE_failbit, os1.base_ios.state); + ok(fb1.base.pbase == NULL, "wrong put base, expected %p got %p\n", NULL, fb1.base.pbase); + ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); + os1.base_ios.state = IOSTATE_badbit; + pos = (ostream*) call_func2(p_ostream_seekp, &os1, -1); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == (IOSTATE_badbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_badbit|IOSTATE_failbit, os1.base_ios.state); + call_func1(p_ostream_vbase_dtor, &os1); call_func1(p_ostream_vbase_dtor, &os2); call_func1(p_filebuf_dtor, &fb1);
1
0
0
0
Iván Matellanes : msvcirt: Implement ostream::write.
by Alexandre Julliard
15 Jun '16
15 Jun '16
Module: wine Branch: master Commit: c4a5730ec3eb79c0ab341c5dc001a1b104b56a12 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c4a5730ec3eb79c0ab341c5dc…
Author: Iván Matellanes <matellanesivan(a)gmail.com> Date: Tue Jun 14 15:40:21 2016 +0100 msvcirt: Implement ostream::write. Signed-off-by: Iván Matellanes <matellanes.ivan(a)gmail.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcirt/msvcirt.c | 16 +++++++++++----- dlls/msvcirt/tests/msvcirt.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c index 75c5a9d..9cb7a5c 100644 --- a/dlls/msvcirt/msvcirt.c +++ b/dlls/msvcirt/msvcirt.c @@ -2506,7 +2506,15 @@ streampos __thiscall ostream_tellp(ostream *this) DEFINE_THISCALL_WRAPPER(ostream_write_char, 12) ostream* __thiscall ostream_write_char(ostream *this, const char *str, int count) { - FIXME("(%p %s %d) stub\n", this, str, count); + ios *base = ostream_get_ios(this); + + TRACE("(%p %p %d)\n", this, str, count); + + if (ostream_opfx(this)) { + if (streambuf_sputn(base->sb, str, count) != count) + base->state = IOSTATE_badbit | IOSTATE_failbit; + ostream_osfx(this); + } return this; } @@ -2515,8 +2523,7 @@ ostream* __thiscall ostream_write_char(ostream *this, const char *str, int count DEFINE_THISCALL_WRAPPER(ostream_write_signed_char, 12) ostream* __thiscall ostream_write_signed_char(ostream *this, const signed char *str, int count) { - FIXME("(%p %s %d) stub\n", this, str, count); - return this; + return ostream_write_char(this, (const char*) str, count); } /* ?write@ostream@@QAEAAV1@PBEH@Z */ @@ -2524,8 +2531,7 @@ ostream* __thiscall ostream_write_signed_char(ostream *this, const signed char * DEFINE_THISCALL_WRAPPER(ostream_write_unsigned_char, 12) ostream* __thiscall ostream_write_unsigned_char(ostream *this, const unsigned char *str, int count) { - FIXME("(%p %s %d) stub\n", this, str, count); - return this; + return ostream_write_char(this, (const char*) str, count); } /* ?writepad@ostream@@AAEAAV1@PBD0@Z */ diff --git a/dlls/msvcirt/tests/msvcirt.c b/dlls/msvcirt/tests/msvcirt.c index f846c9e..0563046 100644 --- a/dlls/msvcirt/tests/msvcirt.c +++ b/dlls/msvcirt/tests/msvcirt.c @@ -265,6 +265,7 @@ static ostream* (*__thiscall p_ostream_flush)(ostream*); static int (*__thiscall p_ostream_opfx)(ostream*); static void (*__thiscall p_ostream_osfx)(ostream*); static ostream* (*__thiscall p_ostream_put_char)(ostream*, char); +static ostream* (*__thiscall p_ostream_write_char)(ostream*, const char*, int); /* Emulate a __thiscall */ #ifdef __i386__ @@ -434,6 +435,7 @@ static BOOL init(void) SET(p_ostream_opfx, "?opfx@ostream@@QEAAHXZ"); SET(p_ostream_osfx, "?osfx@ostream@@QEAAXXZ"); SET(p_ostream_put_char, "?put@ostream@@QEAAAEAV1@D@Z"); + SET(p_ostream_write_char, "?write@ostream@@QEAAAEAV1@PEBDH@Z"); } else { p_operator_new = (void*)GetProcAddress(msvcrt, "??2@YAPAXI@Z"); p_operator_delete = (void*)GetProcAddress(msvcrt, "??3@YAXPAX@Z"); @@ -533,6 +535,7 @@ static BOOL init(void) SET(p_ostream_opfx, "?opfx@ostream@@QAEHXZ"); SET(p_ostream_osfx, "?osfx@ostream@@QAEXXZ"); SET(p_ostream_put_char, "?put@ostream@@QAEAAV1@D@Z"); + SET(p_ostream_write_char, "?write@ostream@@QAEAAV1@PBDH@Z"); } SET(p_ios_static_lock, "?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A"); SET(p_ios_lockc, "?lockc@ios@@KAXXZ"); @@ -2781,6 +2784,38 @@ if (0) /* crashes on native */ ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); fb1.fd = fd; + /* write */ + pos = (ostream*) call_func3(p_ostream_write_char, &os1, "Your", 4); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == (IOSTATE_badbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_badbit|IOSTATE_failbit, os1.base_ios.state); + ok(fb1.base.pbase == NULL, "wrong put base, expected %p got %p\n", NULL, fb1.base.pbase); + ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); + os1.base_ios.state = IOSTATE_goodbit; + os1.base_ios.width = 1; + pos = (ostream*) call_func3(p_ostream_write_char, &os1, "heart's", 7); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == IOSTATE_goodbit, "expected %d got %d\n", IOSTATE_goodbit, os1.base_ios.state); + ok(os1.base_ios.width == 0, "expected 0 got %d\n", os1.base_ios.width); + ok(fb1.base.pbase == fb1.base.base, "wrong put base, expected %p got %p\n", fb1.base.base, fb1.base.pbase); + ok(fb1.base.pptr == fb1.base.base + 7, "wrong put pointer, expected %p got %p\n", fb1.base.base + 7, fb1.base.pptr); + os1.base_ios.sb = NULL; +if (0) /* crashes on native */ + pos = (ostream*) call_func3(p_ostream_write_char, &os1, "been", 4); + os1.base_ios.sb = (streambuf*) &fb1; + os1.base_ios.width = 5; + call_func1(p_filebuf_sync, &fb1); + fd = fb1.fd; + fb1.fd = -1; + pos = (ostream*) call_func3(p_ostream_write_char, &os1, "aching,", 7); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == (IOSTATE_badbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_badbit|IOSTATE_failbit, os1.base_ios.state); + ok(os1.base_ios.width == 0, "expected 0 got %d\n", os1.base_ios.width); + ok(fb1.base.pbase == NULL, "wrong put base, expected %p got %p\n", NULL, fb1.base.pbase); + ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); + fb1.fd = fd; + call_func1(p_ostream_vbase_dtor, &os1); call_func1(p_ostream_vbase_dtor, &os2); call_func1(p_filebuf_dtor, &fb1);
1
0
0
0
Iván Matellanes : msvcirt: Implement ostream::put.
by Alexandre Julliard
15 Jun '16
15 Jun '16
Module: wine Branch: master Commit: e1b3a5290262c19d4e49dfbb30b8c96f300b86af URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e1b3a5290262c19d4e49dfbb3…
Author: Iván Matellanes <matellanesivan(a)gmail.com> Date: Tue Jun 14 15:40:20 2016 +0100 msvcirt: Implement ostream::put. Signed-off-by: Iván Matellanes <matellanes.ivan(a)gmail.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcirt/msvcirt.c | 16 +++++++++----- dlls/msvcirt/tests/msvcirt.c | 51 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 6 deletions(-) diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c index 6872383..75c5a9d 100644 --- a/dlls/msvcirt/msvcirt.c +++ b/dlls/msvcirt/msvcirt.c @@ -2446,7 +2446,15 @@ void __thiscall ostream_osfx(ostream *this) DEFINE_THISCALL_WRAPPER(ostream_put_char, 8) ostream* __thiscall ostream_put_char(ostream *this, char c) { - FIXME("(%p %c) stub\n", this, c); + ios *base = ostream_get_ios(this); + + TRACE("(%p %c)\n", this, c); + + if (ostream_opfx(this)) { + if (streambuf_sputc(base->sb, c) == EOF) + base->state = IOSTATE_badbit | IOSTATE_failbit; + ostream_osfx(this); + } return this; } @@ -2455,8 +2463,7 @@ ostream* __thiscall ostream_put_char(ostream *this, char c) DEFINE_THISCALL_WRAPPER(ostream_put_signed_char, 8) ostream* __thiscall ostream_put_signed_char(ostream *this, signed char c) { - FIXME("(%p %c) stub\n", this, c); - return this; + return ostream_put_char(this, (char) c); } /* ?put@ostream@@QAEAAV1@E@Z */ @@ -2464,8 +2471,7 @@ ostream* __thiscall ostream_put_signed_char(ostream *this, signed char c) DEFINE_THISCALL_WRAPPER(ostream_put_unsigned_char, 8) ostream* __thiscall ostream_put_unsigned_char(ostream *this, unsigned char c) { - FIXME("(%p %c) stub\n", this, c); - return this; + return ostream_put_char(this, (char) c); } /* ?seekp@ostream@@QAEAAV1@J@Z */ diff --git a/dlls/msvcirt/tests/msvcirt.c b/dlls/msvcirt/tests/msvcirt.c index f29bafd..f846c9e 100644 --- a/dlls/msvcirt/tests/msvcirt.c +++ b/dlls/msvcirt/tests/msvcirt.c @@ -264,6 +264,7 @@ static void (*__thiscall p_ostream_vbase_dtor)(ostream*); static ostream* (*__thiscall p_ostream_flush)(ostream*); static int (*__thiscall p_ostream_opfx)(ostream*); static void (*__thiscall p_ostream_osfx)(ostream*); +static ostream* (*__thiscall p_ostream_put_char)(ostream*, char); /* Emulate a __thiscall */ #ifdef __i386__ @@ -432,6 +433,7 @@ static BOOL init(void) SET(p_ostream_flush, "?flush@ostream@@QEAAAEAV1@XZ"); SET(p_ostream_opfx, "?opfx@ostream@@QEAAHXZ"); SET(p_ostream_osfx, "?osfx@ostream@@QEAAXXZ"); + SET(p_ostream_put_char, "?put@ostream@@QEAAAEAV1@D@Z"); } else { p_operator_new = (void*)GetProcAddress(msvcrt, "??2@YAPAXI@Z"); p_operator_delete = (void*)GetProcAddress(msvcrt, "??3@YAXPAX@Z"); @@ -530,6 +532,7 @@ static BOOL init(void) SET(p_ostream_flush, "?flush@ostream@@QAEAAV1@XZ"); SET(p_ostream_opfx, "?opfx@ostream@@QAEHXZ"); SET(p_ostream_osfx, "?osfx@ostream@@QAEXXZ"); + SET(p_ostream_put_char, "?put@ostream@@QAEAAV1@D@Z"); } SET(p_ios_static_lock, "?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A"); SET(p_ios_lockc, "?lockc@ios@@KAXXZ"); @@ -2520,7 +2523,7 @@ static void test_ostream(void) { filebuf fb1, fb2, *pfb; const char filename1[] = "test1"; const char filename2[] = "test2"; - int ret; + int fd, ret; memset(&os1, 0xab, sizeof(ostream)); memset(&os2, 0xab, sizeof(ostream)); @@ -2732,6 +2735,52 @@ if (0) /* crashes on native */ ok(fb1.base.pbase == NULL, "wrong put base, expected %p got %p\n", NULL, fb1.base.pbase); ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); + /* put */ + ret = (int) call_func3(p_streambuf_xsputn, &fb2.base, "for so long", 11); + ok(ret == 11, "expected 11 got %d\n", ret); + os1.base_ios.state = IOSTATE_badbit; + os1.base_ios.width = 2; + pos = (ostream*) call_func2(p_ostream_put_char, &os1, 'a'); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == (IOSTATE_badbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_badbit|IOSTATE_failbit, os1.base_ios.state); + ok(os1.base_ios.width == 2, "expected 2 got %d\n", os1.base_ios.width); + ok(fb1.base.pbase == NULL, "wrong put base, expected %p got %p\n", NULL, fb1.base.pbase); + ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); + ok(fb2.base.pbase == fb2.base.base, "wrong put base, expected %p got %p\n", fb2.base.base, fb2.base.pbase); + ok(fb2.base.pptr == fb2.base.base + 11, "wrong put pointer, expected %p got %p\n", fb2.base.base + 11, fb2.base.pptr); + os1.base_ios.state = IOSTATE_goodbit; + pos = (ostream*) call_func2(p_ostream_put_char, &os1, 'a'); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == IOSTATE_goodbit, "expected %d got %d\n", IOSTATE_goodbit, os1.base_ios.state); + ok(os1.base_ios.width == 0, "expected 0 got %d\n", os1.base_ios.width); + ok(fb1.base.pbase == NULL, "wrong put base, expected %p got %p\n", NULL, fb1.base.pbase); + ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); + ok(fb2.base.pbase == NULL, "wrong put base, expected %p got %p\n", NULL, fb2.base.pbase); + ok(fb2.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb2.base.pptr); + os1.base_ios.flags = 0; + pos = (ostream*) call_func2(p_ostream_put_char, &os1, 'b'); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == IOSTATE_goodbit, "expected %d got %d\n", IOSTATE_goodbit, os1.base_ios.state); + ok(fb1.base.pbase == fb1.base.base, "wrong put base, expected %p got %p\n", fb1.base.base, fb1.base.pbase); + ok(fb1.base.pptr == fb1.base.base + 1, "wrong put pointer, expected %p got %p\n", fb1.base.base + 1, fb1.base.pptr); + os1.base_ios.sb = NULL; +if (0) /* crashes on native */ + pos = (ostream*) call_func2(p_ostream_put_char, &os1, 'c'); + os1.base_ios.sb = (streambuf*) &fb1; + os1.base_ios.width = 5; + call_func1(p_filebuf_sync, &fb1); + fd = fb1.fd; + fb1.fd = -1; + pos = (ostream*) call_func2(p_ostream_put_char, &os1, 'c'); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == (IOSTATE_badbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_badbit|IOSTATE_failbit, os1.base_ios.state); + ok(os1.base_ios.width == 0, "expected 0 got %d\n", os1.base_ios.width); + ok(fb1.base.pbase == NULL, "wrong put base, expected %p got %p\n", NULL, fb1.base.pbase); + ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); + fb1.fd = fd; + call_func1(p_ostream_vbase_dtor, &os1); call_func1(p_ostream_vbase_dtor, &os2); call_func1(p_filebuf_dtor, &fb1);
1
0
0
0
Iván Matellanes : msvcirt: Implement ostream::osfx.
by Alexandre Julliard
15 Jun '16
15 Jun '16
Module: wine Branch: master Commit: 28d400be632d7675737f2ab57cdc5d31cbbfd72f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=28d400be632d7675737f2ab57…
Author: Iván Matellanes <matellanesivan(a)gmail.com> Date: Tue Jun 14 15:40:19 2016 +0100 msvcirt: Implement ostream::osfx. Signed-off-by: Iván Matellanes <matellanes.ivan(a)gmail.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcirt/msvcirt.c | 14 +++++++++++++- dlls/msvcirt/tests/msvcirt.c | 25 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c index 54012c0..6872383 100644 --- a/dlls/msvcirt/msvcirt.c +++ b/dlls/msvcirt/msvcirt.c @@ -2426,7 +2426,19 @@ int __thiscall ostream_opfx(ostream *this) DEFINE_THISCALL_WRAPPER(ostream_osfx, 4) void __thiscall ostream_osfx(ostream *this) { - FIXME("(%p) stub\n", this); + ios *base = ostream_get_ios(this); + + TRACE("(%p)\n", this); + + ios_unlockbuf(base); + ios_width_set(base, 0); + if (base->flags & FLAGS_unitbuf) + ostream_flush(this); + if (base->flags & FLAGS_stdio) { + fflush(stdout); + fflush(stderr); + } + ios_unlock(base); } /* ?put@ostream@@QAEAAV1@D@Z */ diff --git a/dlls/msvcirt/tests/msvcirt.c b/dlls/msvcirt/tests/msvcirt.c index 7197126..f29bafd 100644 --- a/dlls/msvcirt/tests/msvcirt.c +++ b/dlls/msvcirt/tests/msvcirt.c @@ -263,6 +263,7 @@ static ostream* (*__thiscall p_ostream_assign_sb)(ostream*, streambuf*); static void (*__thiscall p_ostream_vbase_dtor)(ostream*); static ostream* (*__thiscall p_ostream_flush)(ostream*); static int (*__thiscall p_ostream_opfx)(ostream*); +static void (*__thiscall p_ostream_osfx)(ostream*); /* Emulate a __thiscall */ #ifdef __i386__ @@ -430,6 +431,7 @@ static BOOL init(void) SET(p_ostream_vbase_dtor, "??_Dostream@@QEAAXXZ"); SET(p_ostream_flush, "?flush@ostream@@QEAAAEAV1@XZ"); SET(p_ostream_opfx, "?opfx@ostream@@QEAAHXZ"); + SET(p_ostream_osfx, "?osfx@ostream@@QEAAXXZ"); } else { p_operator_new = (void*)GetProcAddress(msvcrt, "??2@YAPAXI@Z"); p_operator_delete = (void*)GetProcAddress(msvcrt, "??3@YAXPAX@Z"); @@ -527,6 +529,7 @@ static BOOL init(void) SET(p_ostream_vbase_dtor, "??_Dostream@@QAEXXZ"); SET(p_ostream_flush, "?flush@ostream@@QAEAAV1@XZ"); SET(p_ostream_opfx, "?opfx@ostream@@QAEHXZ"); + SET(p_ostream_osfx, "?osfx@ostream@@QAEXXZ"); } SET(p_ios_static_lock, "?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A"); SET(p_ios_lockc, "?lockc@ios@@KAXXZ"); @@ -2707,6 +2710,28 @@ if (0) /* crashes on native */ ok(fb2.base.pbase == NULL, "wrong put base, expected %p got %p\n", NULL, fb2.base.pbase); ok(fb2.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb2.base.pptr); + /* osfx */ + os1.base_ios.state = IOSTATE_badbit; + os1.base_ios.width = 0xab; + call_func1(p_ostream_osfx, &os1); + ok(os1.base_ios.state == IOSTATE_badbit, "expected %d got %d\n", IOSTATE_badbit, os1.base_ios.state); + ok(os1.base_ios.width == 0, "expected 0 got %d\n", os1.base_ios.width); + ok(fb1.base.pbase == fb1.base.base, "wrong put base, expected %p got %p\n", fb1.base.base, fb1.base.pbase); + ok(fb1.base.pptr == fb1.base.base + 22, "wrong put pointer, expected %p got %p\n", fb1.base.base + 22, fb1.base.pptr); + os1.base_ios.state = IOSTATE_goodbit; + ret = (int) call_func1(p_ostream_opfx, &os1); + ok(ret == 1, "expected 1 got %d\n", ret); + os1.base_ios.sb = NULL; +if (0) /* crashes on native */ + call_func1(p_ostream_osfx, &os1); + os1.base_ios.sb = (streambuf*) &fb1; + os1.base_ios.flags = FLAGS_unitbuf; + call_func1(p_ostream_osfx, &os1); + ok(os1.base_ios.state == IOSTATE_goodbit, "expected %d got %d\n", IOSTATE_goodbit, os1.base_ios.state); + ok(os1.base_ios.flags == FLAGS_unitbuf, "expected %d got %d\n", FLAGS_unitbuf, os1.base_ios.flags); + ok(fb1.base.pbase == NULL, "wrong put base, expected %p got %p\n", NULL, fb1.base.pbase); + ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); + call_func1(p_ostream_vbase_dtor, &os1); call_func1(p_ostream_vbase_dtor, &os2); call_func1(p_filebuf_dtor, &fb1);
1
0
0
0
Iván Matellanes : msvcirt: Implement ostream::opfx.
by Alexandre Julliard
15 Jun '16
15 Jun '16
Module: wine Branch: master Commit: 327cada0f1b81a3fd55f1a9047317ded2c6b149c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=327cada0f1b81a3fd55f1a904…
Author: Iván Matellanes <matellanesivan(a)gmail.com> Date: Tue Jun 14 15:40:18 2016 +0100 msvcirt: Implement ostream::opfx. Signed-off-by: Iván Matellanes <matellanes.ivan(a)gmail.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcirt/msvcirt.c | 15 +++++++++++++-- dlls/msvcirt/tests/msvcirt.c | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c index 2d9c235..54012c0 100644 --- a/dlls/msvcirt/msvcirt.c +++ b/dlls/msvcirt/msvcirt.c @@ -2406,8 +2406,19 @@ ostream* __thiscall ostream_flush(ostream *this) DEFINE_THISCALL_WRAPPER(ostream_opfx, 4) int __thiscall ostream_opfx(ostream *this) { - FIXME("(%p) stub\n", this); - return 0; + ios *base = ostream_get_ios(this); + + TRACE("(%p)\n", this); + + if (!ios_good(base)) { + ios_clear(base, base->state | IOSTATE_failbit); + return 0; + } + ios_lock(base); + ios_lockbuf(base); + if (base->tie) + ostream_flush(base->tie); + return 1; } /* ?osfx@ostream@@QAEXXZ */ diff --git a/dlls/msvcirt/tests/msvcirt.c b/dlls/msvcirt/tests/msvcirt.c index 045c224..7197126 100644 --- a/dlls/msvcirt/tests/msvcirt.c +++ b/dlls/msvcirt/tests/msvcirt.c @@ -262,6 +262,7 @@ static ostream* (*__thiscall p_ostream_assign)(ostream*, const ostream*); static ostream* (*__thiscall p_ostream_assign_sb)(ostream*, streambuf*); static void (*__thiscall p_ostream_vbase_dtor)(ostream*); static ostream* (*__thiscall p_ostream_flush)(ostream*); +static int (*__thiscall p_ostream_opfx)(ostream*); /* Emulate a __thiscall */ #ifdef __i386__ @@ -428,6 +429,7 @@ static BOOL init(void) SET(p_ostream_assign_sb, "??4ostream@@IEAAAEAV0@PEAVstreambuf@@@Z"); SET(p_ostream_vbase_dtor, "??_Dostream@@QEAAXXZ"); SET(p_ostream_flush, "?flush@ostream@@QEAAAEAV1@XZ"); + SET(p_ostream_opfx, "?opfx@ostream@@QEAAHXZ"); } else { p_operator_new = (void*)GetProcAddress(msvcrt, "??2@YAPAXI@Z"); p_operator_delete = (void*)GetProcAddress(msvcrt, "??3@YAXPAX@Z"); @@ -524,6 +526,7 @@ static BOOL init(void) SET(p_ostream_assign_sb, "??4ostream@@IAEAAV0@PAVstreambuf@@@Z"); SET(p_ostream_vbase_dtor, "??_Dostream@@QAEXXZ"); SET(p_ostream_flush, "?flush@ostream@@QAEAAV1@XZ"); + SET(p_ostream_opfx, "?opfx@ostream@@QAEHXZ"); } SET(p_ios_static_lock, "?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A"); SET(p_ios_lockc, "?lockc@ios@@KAXXZ"); @@ -2666,6 +2669,44 @@ if (0) /* crashes on native */ ok(fb2.base.pbase == fb2.base.base, "wrong put base, expected %p got %p\n", fb2.base.base, fb2.base.pbase); ok(fb2.base.pptr == fb2.base.base + 12, "wrong put pointer, expected %p got %p\n", fb2.base.base + 12, fb2.base.pptr); + /* opfx */ + ret = (int) call_func1(p_ostream_opfx, &os1); + ok(ret == 0, "expected 0 got %d\n", ret); + ok(os1.base_ios.state == (IOSTATE_eofbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_eofbit|IOSTATE_failbit, os1.base_ios.state); + os1.base_ios.state = IOSTATE_badbit; + ret = (int) call_func1(p_ostream_opfx, &os1); + ok(ret == 0, "expected 0 got %d\n", ret); + ok(os1.base_ios.state == (IOSTATE_badbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_badbit|IOSTATE_failbit, os1.base_ios.state); + os1.base_ios.sb = (streambuf*) &fb1; + os1.base_ios.state = IOSTATE_badbit; + ret = (int) call_func1(p_ostream_opfx, &os1); + ok(ret == 0, "expected 0 got %d\n", ret); + ok(os1.base_ios.state == (IOSTATE_badbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_badbit|IOSTATE_failbit, os1.base_ios.state); + os1.base_ios.state = IOSTATE_failbit; + ret = (int) call_func1(p_ostream_opfx, &os1); + ok(ret == 0, "expected 0 got %d\n", ret); + ok(os1.base_ios.state == IOSTATE_failbit, "expected %d got %d\n", IOSTATE_failbit, os1.base_ios.state); + os1.base_ios.state = IOSTATE_goodbit; + os1.base_ios.tie = &os2; + os2.base_ios.sb = NULL; +if (0) /* crashes on native */ + ret = (int) call_func1(p_ostream_opfx, &os1); + os2.base_ios.sb = (streambuf*) &fb2; + os2.base_ios.state = IOSTATE_badbit; + ret = (int) call_func3(p_streambuf_xsputn, &fb1.base, "We've known each other", 22); + ok(ret == 22, "expected 22 got %d\n", ret); + ret = (int) call_func1(p_ostream_opfx, &os1); + ok(ret == 1, "expected 1 got %d\n", ret); + ok(os1.base_ios.state == IOSTATE_goodbit, "expected %d got %d\n", IOSTATE_goodbit, os1.base_ios.state); + ok(os2.base_ios.state == IOSTATE_badbit, "expected %d got %d\n", IOSTATE_badbit, os2.base_ios.state); + ok(fb1.base.pbase == fb1.base.base, "wrong put base, expected %p got %p\n", fb1.base.base, fb1.base.pbase); + ok(fb1.base.pptr == fb1.base.base + 22, "wrong put pointer, expected %p got %p\n", fb1.base.base + 22, fb1.base.pptr); + ok(fb2.base.pbase == NULL, "wrong put base, expected %p got %p\n", NULL, fb2.base.pbase); + ok(fb2.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb2.base.pptr); + call_func1(p_ostream_vbase_dtor, &os1); call_func1(p_ostream_vbase_dtor, &os2); call_func1(p_filebuf_dtor, &fb1);
1
0
0
0
Iván Matellanes : msvcirt: Implement ostream::flush.
by Alexandre Julliard
15 Jun '16
15 Jun '16
Module: wine Branch: master Commit: 6fedfa6128e548a7280a2507ed22efa1df7fe3db URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6fedfa6128e548a7280a2507e…
Author: Iván Matellanes <matellanesivan(a)gmail.com> Date: Tue Jun 14 15:40:17 2016 +0100 msvcirt: Implement ostream::flush. Signed-off-by: Iván Matellanes <matellanes.ivan(a)gmail.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcirt/msvcirt.c | 9 ++++++++- dlls/msvcirt/tests/msvcirt.c | 44 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c index 6358e94..2d9c235 100644 --- a/dlls/msvcirt/msvcirt.c +++ b/dlls/msvcirt/msvcirt.c @@ -2390,7 +2390,14 @@ ostream* __thiscall ostream_scalar_dtor(ios *base, unsigned int flags) DEFINE_THISCALL_WRAPPER(ostream_flush, 4) ostream* __thiscall ostream_flush(ostream *this) { - FIXME("(%p) stub\n", this); + ios *base = ostream_get_ios(this); + + TRACE("(%p)\n", this); + + ios_lockbuf(base); + if (call_streambuf_sync(base->sb) == EOF) + ios_clear(base, base->state | IOSTATE_failbit); + ios_unlockbuf(base); return this; } diff --git a/dlls/msvcirt/tests/msvcirt.c b/dlls/msvcirt/tests/msvcirt.c index f17c2ef..045c224 100644 --- a/dlls/msvcirt/tests/msvcirt.c +++ b/dlls/msvcirt/tests/msvcirt.c @@ -261,6 +261,7 @@ static void (*__thiscall p_ostream_dtor)(ios*); static ostream* (*__thiscall p_ostream_assign)(ostream*, const ostream*); static ostream* (*__thiscall p_ostream_assign_sb)(ostream*, streambuf*); static void (*__thiscall p_ostream_vbase_dtor)(ostream*); +static ostream* (*__thiscall p_ostream_flush)(ostream*); /* Emulate a __thiscall */ #ifdef __i386__ @@ -426,6 +427,7 @@ static BOOL init(void) SET(p_ostream_assign, "??4ostream@@IEAAAEAV0@AEBV0@@Z"); SET(p_ostream_assign_sb, "??4ostream@@IEAAAEAV0@PEAVstreambuf@@@Z"); SET(p_ostream_vbase_dtor, "??_Dostream@@QEAAXXZ"); + SET(p_ostream_flush, "?flush@ostream@@QEAAAEAV1@XZ"); } else { p_operator_new = (void*)GetProcAddress(msvcrt, "??2@YAPAXI@Z"); p_operator_delete = (void*)GetProcAddress(msvcrt, "??3@YAXPAX@Z"); @@ -521,6 +523,7 @@ static BOOL init(void) SET(p_ostream_assign, "??4ostream@@IAEAAV0@ABV0@@Z"); SET(p_ostream_assign_sb, "??4ostream@@IAEAAV0@PAVstreambuf@@@Z"); SET(p_ostream_vbase_dtor, "??_Dostream@@QAEXXZ"); + SET(p_ostream_flush, "?flush@ostream@@QAEAAV1@XZ"); } SET(p_ios_static_lock, "?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A"); SET(p_ios_lockc, "?lockc@ios@@KAXXZ"); @@ -2508,12 +2511,15 @@ static void test_ios(void) static void test_ostream(void) { ostream os1, os2, *pos; - filebuf fb1, *pfb; + filebuf fb1, fb2, *pfb; const char filename1[] = "test1"; + const char filename2[] = "test2"; + int ret; memset(&os1, 0xab, sizeof(ostream)); memset(&os2, 0xab, sizeof(ostream)); memset(&fb1, 0xab, sizeof(filebuf)); + memset(&fb2, 0xab, sizeof(filebuf)); /* constructors/destructors */ pos = (ostream*) call_func2(p_ostream_ctor, &os1, TRUE); @@ -2626,10 +2632,46 @@ static void test_ostream(void) { ok(os2.base_ios.state == IOSTATE_badbit, "expected %d got %d\n", IOSTATE_badbit, os2.base_ios.state); ok(os2.base_ios.special[0] == 0xcdcdcdcd, "expected %d got %d\n", 0xcdcdcdcd, os2.base_ios.fill); + /* flush */ +if (0) /* crashes on native */ + pos = (ostream*) call_func1(p_ostream_flush, &os1); + os1.base_ios.sb = (streambuf*) &fb2; + call_func1(p_filebuf_ctor, &fb2); + pos = (ostream*) call_func1(p_ostream_flush, &os1); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == (IOSTATE_badbit|IOSTATE_failbit), "expected %d got %d\n", + IOSTATE_badbit|IOSTATE_failbit, os1.base_ios.state); + os1.base_ios.sb = (streambuf*) &fb1; + os1.base_ios.state = IOSTATE_eofbit; + ret = (int) call_func3(p_streambuf_xsputn, &fb1.base, "Never gonna tell a lie", 22); + ok(ret == 22, "expected 22 got %d\n", ret); + ok(fb1.base.pbase == fb1.base.base, "wrong put base, expected %p got %p\n", fb1.base.base, fb1.base.pbase); + ok(fb1.base.pptr == fb1.base.base + 22, "wrong put pointer, expected %p got %p\n", fb1.base.base + 22, fb1.base.pptr); + pos = (ostream*) call_func1(p_ostream_flush, &os1); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(os1.base_ios.state == IOSTATE_eofbit, "expected %d got %d\n", IOSTATE_eofbit, os1.base_ios.state); + ok(fb1.base.pbase == NULL, "wrong put base, expected %p got %p\n", NULL, fb1.base.pbase); + ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); + os1.base_ios.tie = &os2; + os2.base_ios.sb = (streambuf*) &fb2; + os2.base_ios.state = IOSTATE_goodbit; + pfb = (filebuf*) call_func4(p_filebuf_open, &fb2, filename2, OPENMODE_out, filebuf_openprot); + ok(pfb == &fb2, "wrong return, expected %p got %p\n", &fb2, pfb); + ret = (int) call_func3(p_streambuf_xsputn, &fb2.base, "and hurt you", 12); + ok(ret == 12, "expected 12 got %d\n", ret); + ok(fb2.base.pbase == fb2.base.base, "wrong put base, expected %p got %p\n", fb2.base.base, fb2.base.pbase); + ok(fb2.base.pptr == fb2.base.base + 12, "wrong put pointer, expected %p got %p\n", fb2.base.base + 12, fb2.base.pptr); + pos = (ostream*) call_func1(p_ostream_flush, &os1); + ok(pos == &os1, "wrong return, expected %p got %p\n", &os1, pos); + ok(fb2.base.pbase == fb2.base.base, "wrong put base, expected %p got %p\n", fb2.base.base, fb2.base.pbase); + ok(fb2.base.pptr == fb2.base.base + 12, "wrong put pointer, expected %p got %p\n", fb2.base.base + 12, fb2.base.pptr); + call_func1(p_ostream_vbase_dtor, &os1); call_func1(p_ostream_vbase_dtor, &os2); call_func1(p_filebuf_dtor, &fb1); + call_func1(p_filebuf_dtor, &fb2); ok(_unlink(filename1) == 0, "Couldn't unlink file named '%s'\n", filename1); + ok(_unlink(filename2) == 0, "Couldn't unlink file named '%s'\n", filename2); } START_TEST(msvcirt)
1
0
0
0
← Newer
1
...
32
33
34
35
36
37
38
...
60
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Results per page:
10
25
50
100
200