From 4b9289cfb260f4bcecaf23a810584ef6ef8e8501 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 30 Mar 2011 22:33:41 +0000 Subject: Ok, string stuff is working much, much better, a load of new unit tests have been added, and I deleted a whole slew of stupid old tests that I don't need. --- src/tests/fastcgi.cpp | 90 --------------------------------------------------- 1 file changed, 90 deletions(-) delete mode 100644 src/tests/fastcgi.cpp (limited to 'src/tests/fastcgi.cpp') diff --git a/src/tests/fastcgi.cpp b/src/tests/fastcgi.cpp deleted file mode 100644 index 7447a6f..0000000 --- a/src/tests/fastcgi.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2007-2011 Xagasoft, All rights reserved. - * - * This file is part of the libbu++ library and is released under the - * terms of the license contained in the file LICENSE. - */ - -#include "bu/fastcgi.h" - -#include - -class Cgi : public Bu::FastCgi -{ -public: - Cgi() : - Bu::FastCgi::FastCgi() - { - } - - Cgi( int iPort ) : - Bu::FastCgi::FastCgi( iPort ) - { - } - - virtual ~Cgi() - { - } - - virtual int onRequest( const StrHash &hParams, - const Bu::String &sStdIn, Bu::Stream &sStdOut, - Bu::Stream &/*sStdErr*/ ) - { - Bu::String sOut("Content-Type: text/html\r\n\r\n"); - sOut += "

Environment:

"; - char buf[2048]; - sOut += "

Cwd:

"; - sOut += "

Stdin:

"; - sOut += Bu::String("%1 bytes
").arg( sStdIn.getSize() );
-		Bu::String sL, sR;
-		for( Bu::String::const_iterator i = sStdIn.begin();
-			i; i++ )
-		{
-			sL += Bu::String("%1").arg(
-					(unsigned int)((unsigned char)*i), Bu::Fmt::hex().width(2).fill('0') );
-			if( *i < 27 )
-				sR += ". ";
-			else
-				sR += Bu::String("&#%1; ").arg(
-					(unsigned int)((unsigned char)*i) );
-			if( sL.getSize()/3 == 8 )
-			{
-				sOut += sL + " | " + sR + "\n";
-				sL = sR = "";
-			}
-		}
-		if( sL != "" )
-		{
-			while( sL.getSize()/3 < 8 )
-				sL += "   ";
-			sOut += sL + " | " + sR + "\n";
-		}
-		sOut += "

";
-		sOut += sStdIn;
-		sOut += "
"; - sOut += "


"; - sOut += ""; - - sStdOut.write( sOut ); - - return 0; - } -}; - -int main() -{ - Cgi c( 8789 ); - - c.run(); - - return 0; -} - -- cgit v1.2.3