From: K. G. <kim...@gm...> - 2008-09-02 21:01:37
Attachments:
http_server_fixture.patch
|
Hello, I've spent a couple of hours getting used to Boost, cpp-netlib, etc, and spent those cleaning up localhost_tests.cpp. Here's a patch that does a lot: - extracts http_test_server.hpp wrapping ShellExecuteEx/fork - http_test_server no longer stops with an error dialog if Python is not installed, but rather fails with an error message on the console - uses global fixture for starting/stopping the Python test server (independent of test run order) - cleaned some file i/o out of text_file_query and binary_file_query into helper function readfile - consistent tab size in localhost_tests.cpp - added adjust_lineendings, used with text_file_query to make the source data match the output from the Python server (LF-only line-endings) I wish I could've offered these one-by-one, but it would turn into a versioning nightmare to apply the patches in order. I think most of the changes are benign, I'm a little doubtful of the last one, but until I've fully understood Divye, this is a workaround to make it right on Windows. Hope it helps, - Kim |
From: Dean M. B. <mik...@gm...> - 2008-09-03 05:52:15
|
Hi Kim, Thanks, I'll apply the patch and test. If the tests pass, then I guess it should be alright to commit. I just got a message from Sourceforge though that write access will be disabled until further notice, so it may take a while before this gets into the repository. More later! :) On Wed, Sep 3, 2008 at 5:01 AM, Kim Gräsman <kim...@gm...> wrote: > Hello, > > I've spent a couple of hours getting used to Boost, cpp-netlib, etc, > and spent those cleaning up localhost_tests.cpp. Here's a patch that > does a lot: > > - extracts http_test_server.hpp wrapping ShellExecuteEx/fork > - http_test_server no longer stops with an error dialog if Python is > not installed, but rather fails with an error message on the console > - uses global fixture for starting/stopping the Python test server > (independent of test run order) > - cleaned some file i/o out of text_file_query and binary_file_query > into helper function readfile > - consistent tab size in localhost_tests.cpp > - added adjust_lineendings, used with text_file_query to make the > source data match the output from the Python server (LF-only > line-endings) > > I wish I could've offered these one-by-one, but it would turn into a > versioning nightmare to apply the patches in order. I think most of > the changes are benign, I'm a little doubtful of the last one, but > until I've fully understood Divye, this is a workaround to make it > right on Windows. > > Hope it helps, > - Kim > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Cpp-netlib-devel mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel > > -- Dean Michael C. Berris Software Engineer, Friendster, Inc. |
From: Divye K. <div...@gm...> - 2008-09-03 06:43:48
|
Hi Kim, On Wed, Sep 3, 2008 at 2:31 AM, Kim Gräsman <kim...@gm...> wrote: > Hello, > > I've spent a couple of hours getting used to Boost, cpp-netlib, etc, > and spent those cleaning up localhost_tests.cpp. Here's a patch that > does a lot: > > - extracts http_test_server.hpp wrapping ShellExecuteEx/fork > - http_test_server no longer stops with an error dialog if Python is > not installed, but rather fails with an error message on the console > - uses global fixture for starting/stopping the Python test server > (independent of test run order) > - cleaned some file i/o out of text_file_query and binary_file_query > into helper function readfile > - consistent tab size in localhost_tests.cpp > - added adjust_lineendings, used with text_file_query to make the > source data match the output from the Python server (LF-only > line-endings) > I tried extracting the ShellExecuteEx and Fork into a separate header file and creating the fixture but I was continually running into segmentation faults. So, I put it aside for a while. Thanks for the patch! > I wish I could've offered these one-by-one, but it would turn into a > versioning nightmare to apply the patches in order. I think most of > the changes are benign, I'm a little doubtful of the last one, but > until I've fully understood Divye, this is a workaround to make it > right on Windows. > I think Dean's made a pretty good explanation of what I'm trying to convey. The file size test that fails on Windows actually passes on Linux because the linux version of the python library doesn't convert the CRLF to a single LF. Its a known bug in the Python library that causes the file size mismatch on windows. Although it helps to keep the tests clean, the text file transfer test is an expected failure on Windows. It would be better to mark this test as an expected failure in the test suite rather than making up for the shortcomings of the Python server. I hope that clears things up. Cheers, Divye -- An idealist is one who, on noticing that a rose smells better than a cabbage, concludes that it will also make better soup. H. L. Mencken (1880 - 1956) My official web site: http://people.iitr.ernet.in/shp/061305/ Webmaster: http://www.drkapoorsclinic.com Blog: http://divyekapoor.blogspot.com |
From: K. G. <kim...@gm...> - 2008-09-03 07:26:50
|
Hi Divye, On Wed, Sep 3, 2008 at 08:43, Divye Kapoor <div...@gm...> wrote: > > I tried extracting the ShellExecuteEx and Fork into a separate header file > and creating the fixture but I was continually running into segmentation > faults. So, I put it aside for a while. Thanks for the patch! Oops--let's hope that doesn't show again! I haven't been able to run the tests on Linux, so I've done my best to move the source as it was into the new header. > I think Dean's made a pretty good explanation of what I'm trying to convey. > The file size test that fails on Windows actually passes on Linux because > the linux version of the python library doesn't convert the CRLF to a single > LF. Its a known bug in the Python library that causes the file size mismatch > on windows. Although it helps to keep the tests clean, the text file > transfer test is an expected failure on Windows. It would be better to mark > this test as an expected failure in the test suite rather than making up for > the shortcomings of the Python server. As we've hashed out in other threads, I disagree. I think an expected failure-test is pretty useless. - Kim |