BMW Test (c + + implementation)

Source: Internet
Author: User


Test Purpose: Zoom in on the editor to reduce performance testing.

Test resources: a BMW.

Test result: good.






Implementation method: By calling the locally saved BMW file, the word-by-line display in the editor, and Zoom in and zoom out. Color-handle different symbols.


1. bmw File

     ,...       ,((((   /    `-.-'     )))  ;'    `"'"'""((((   (          (((  /            (((           )) |                      |    ((  |        .       '     |    ))  \     _ '      t   ,. ')    (   |   y;--,-"'"-.\ \      )/   ./  )/         ' \         |. /   ( (           / /'       ||     \\          //'|       ||      \\       _//'||       ||       ))     | _/  ||       \_\     |_/          ||       "" "                  \_" "                            $-lookbmw*/}




2. C + + implementation


A First loads the BMW file, which is displayed in the editor verbatim by line.

CStdioFile Lookbmwfile; CString Bwmfilepath = Pack::getconfiginifile (_t ("Glbbmwfilepath")); Lookbmwfile.open (Bwmfilepath, Cfile::moderead | Cfile::typetext) {MessageBox (_t ("Loading files Error" + Bwmfilepath + ", please reinstall the software ...")); CString Strbmwtxt; BOOL Bwmtxtstart = False;while (lookbmwfile.readstring (strbmwtxt)) {if (Bwmtxtstart) {if (Strbmwtxt = = _t ("$-lookbmw*/}" ) {break;} CString str;for (int i=0; i<strbmwtxt.getlength (); i++) {str = (strbmwtxt[i]); Sendmessages (Sci_addtext, 1, (LPARAM) (LPCSTR) str); UpdateWindow (); Sleep (15);} str = _t ("\ n"); Sendmessages (Sci_addtext, 1, (LPARAM) (LPCSTR) str); if (strbmwtxt.trim () = = _t ("{/*LOOKBMW")) {Bwmtxtstart = TRUE;}} Lookbmwfile.close ();


B Set the magnification multiplier, and zoom in multiples, loop 3 times.

int J=3;int I=5;while (j--) {while (i--) {sendmessages (sci_zoomin, 0, 0); UpdateWindow (); Sleep (70);} I=15;while (i--) {sendmessages (sci_zoomout, 0, 0); UpdateWindow (); Sleep (70);} i=15;} I=10;while (i--) {sendmessages (sci_zoomin, 0, 0); UpdateWindow (); Sleep (70);}



Text/Shing Original reprint please indicate the source http://blog.csdn.net/yxstars/article/details/39205345


BMW Test (c + + implementation)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.