From: <enl...@li...> - 2002-07-30 21:36:04
|
Enlightenment CVS committal Author : mej Project : eterm Module : libast Dir : eterm/libast/test Modified Files: test.c Log Message: Tue Jul 30 17:34:38 2002 Michael Jennings (mej) Send/receive on the socket works now. Also cleaned up the show method for strings to eliminate the 4K length limit. The current socket test will actually download the HTML for my home page. Uncomment the SPIF_SHOW() call in test_socket() to see it work. =================================================================== RCS file: /cvsroot/enlightenment/eterm/libast/test/test.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- test.c 26 Jul 2002 20:57:39 -0000 1.20 +++ test.c 30 Jul 2002 21:36:03 -0000 1.21 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: test.c,v 1.20 2002/07/26 20:57:39 mej Exp $"; +static const char cvs_ident[] = "$Id: test.c,v 1.21 2002/07/30 21:36:03 mej Exp $"; #ifdef HAVE_CONFIG_H # include <config.h> @@ -992,6 +992,7 @@ { spif_socket_t s1, s2; spif_url_t url1, url2; + spif_str_t data; spif_charptr_t tmp1 = "http://www.kainx.org/"; spif_charptr_t tmp2 = "unix:/tmp/.X11-unix/X0"; spif_bool_t b; @@ -1014,6 +1015,20 @@ TEST_FAIL_IF(b == FALSE); b = spif_socket_open(s2); TEST_FAIL_IF(b == FALSE); + TEST_PASS(); + + TEST_BEGIN("spif_socket_send() function"); + data = spif_str_new_from_ptr("GET / HTTP/1.0\015\012Host: www.kainx.org\015\012\015\012"); + b = spif_socket_send(s1, data); + TEST_FAIL_IF(b == FALSE); + spif_str_del(data); + TEST_PASS(); + + TEST_BEGIN("spif_socket_recv() function"); + data = spif_socket_recv(s1); + /*SPIF_SHOW(data, stdout);*/ + TEST_FAIL_IF(SPIF_STR_ISNULL(data)); + spif_str_del(data); TEST_PASS(); TEST_BEGIN("spif_socket_del() function"); |