Jacek Caban : mshtml: Added IHTMLTxtRange::put_text tests.

Alexandre Julliard julliard at winehq.org
Thu Sep 13 07:17:24 CDT 2007


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Sep 12 23:37:33 2007 +0200

mshtml: Added IHTMLTxtRange::put_text tests.

---

 dlls/mshtml/tests/dom.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 2a8a522..a264d72 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -166,6 +166,16 @@ static void _test_range_moveend(unsigned line, IHTMLTxtRange *range, LPWSTR unit
     ok_(__FILE__,line) (c == excnt, "count=%ld, expected %ld\n", c, excnt);
 }
 
+#define test_range_put_text(r,t) _test_range_put_text(__LINE__,r,t)
+static void _test_range_put_text(unsigned line, IHTMLTxtRange *range, LPCWSTR text)
+{
+    HRESULT hres;
+
+    hres = IHTMLTxtRange_put_text(range, (BSTR)text);
+    ok_(__FILE__,line) (hres == S_OK, "put_text failed: %08x\n", hres);
+    _test_range_text(line, range, NULL);
+}
+
 #define test_range_inrange(r1,r2,b) _test_range_inrange(__LINE__,r1,r2,b)
 static void _test_range_inrange(unsigned line, IHTMLTxtRange *range1, IHTMLTxtRange *range2, VARIANT_BOOL exb)
 {
@@ -268,6 +278,8 @@ static void test_txtrange(IHTMLDocument2 *doc)
     test_range_moveend(range, characterW, 2, 2);
     test_range_text(range, "123\r\ni");
 
+    IHTMLTxtRange_Release(range);
+
     hres = IHTMLTxtRange_duplicate(body_range, &range);
     ok(hres == S_OK, "duplicate failed: %08x\n", hres);
 
@@ -319,6 +331,16 @@ static void test_txtrange(IHTMLDocument2 *doc)
     test_range_text(range, "t");
 
     IHTMLTxtRange_Release(range);
+
+    hres = IHTMLTxtRange_duplicate(body_range, &range);
+    ok(hres == S_OK, "duplicate failed: %08x\n", hres);
+
+    test_range_collapse(range, TRUE);
+    test_range_expand(range, wordW, VARIANT_TRUE, "test ");
+    test_range_put_text(range, wordW);
+    test_range_text(body_range, "wordabc 123\r\nit's text");
+
+    IHTMLTxtRange_Release(range);
     IHTMLTxtRange_Release(body_range);
 }
 




More information about the wine-cvs mailing list