msvcirt: Fix implementation of streambuf::sync.

This commit is contained in:
Iván Matellanes 2015-06-12 11:51:54 +02:00 committed by Alexandre Julliard
parent b36a526f5a
commit c69ac67206
2 changed files with 3 additions and 3 deletions

View File

@ -457,7 +457,7 @@ DEFINE_THISCALL_WRAPPER(streambuf_sync, 4)
int __thiscall streambuf_sync(streambuf *this) int __thiscall streambuf_sync(streambuf *this)
{ {
TRACE("(%p)\n", this); TRACE("(%p)\n", this);
return (this->gptr == this->egptr && this->pbase == this->pptr) ? 0 : EOF; return (this->gptr >= this->egptr && this->pbase >= this->pptr) ? 0 : EOF;
} }
/* ?unbuffered@streambuf@@IAEXH@Z */ /* ?unbuffered@streambuf@@IAEXH@Z */

View File

@ -372,7 +372,7 @@ static void test_streambuf(void)
ok(ret == 0, "sync failed, expected 0 got %d\n", ret); ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
sb.gptr = sb.egptr + 1; sb.gptr = sb.egptr + 1;
ret = (int) call_func1(p_streambuf_sync, &sb); ret = (int) call_func1(p_streambuf_sync, &sb);
todo_wine ok(ret == 0, "sync failed, expected 0 got %d\n", ret); ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
sb.gptr = sb.eback; sb.gptr = sb.eback;
ret = (int) call_func1(p_streambuf_sync, &sb2); ret = (int) call_func1(p_streambuf_sync, &sb2);
ok(ret == EOF, "sync failed, expected EOF got %d\n", ret); ok(ret == EOF, "sync failed, expected EOF got %d\n", ret);
@ -381,7 +381,7 @@ static void test_streambuf(void)
ok(ret == 0, "sync failed, expected 0 got %d\n", ret); ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
sb2.pptr = sb2.pbase - 1; sb2.pptr = sb2.pbase - 1;
ret = (int) call_func1(p_streambuf_sync, &sb2); ret = (int) call_func1(p_streambuf_sync, &sb2);
todo_wine ok(ret == 0, "sync failed, expected 0 got %d\n", ret); ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
sb2.pptr = sb2.epptr; sb2.pptr = sb2.epptr;
ret = (int) call_func1(p_streambuf_sync, &sb3); ret = (int) call_func1(p_streambuf_sync, &sb3);
ok(ret == 0, "sync failed, expected 0 got %d\n", ret); ok(ret == 0, "sync failed, expected 0 got %d\n", ret);