Commits

libqxt  committed b48c0fd

fixed the invoke test

  • Participants
  • Parent commits 16c48ed

Comments (0)

Files changed (1)

File tests/web/invoketest/main.cpp

-#include <QxtScgiApplication.h>
-#include <QxtScgiController.h>
+#include <QCoreApplication>
+#include <QxtWebCore>
+#include <QxtWebController>
 
-class test : public QxtScgiController
+class test : public QxtWebController
         {
         Q_OBJECT
         public:
-                test():QxtScgiController("root")
+                test():QxtWebController("root")
 			{
 			}
 
 
 		 int index()
                         {
-			echo()<<"Status: 200 OK\r\nContent-Type: text/html; charset=utf-8\r\n\r\n";
 			echo()<<"foo";
                         return 0;
                         }
 		 int index(QString a, QString b=QString("default"), QString c=QString("default2"))
                         {
-			echo()<<"Status: 200 OK\r\nContent-Type: text/html; charset=utf-8\r\n\r\n";
 			echo()<<"a: "<<a<<"<br/> b: "<<b<<"<br/> c: "<<c;
                         return 0;
                         }
 
         };
 
-class err : public QxtScgiController
+class err : public QxtWebController
         {
         Q_OBJECT
         public:
-                err():QxtScgiController("error")
+                err():QxtWebController("error")
 			{
 			}
 
 		 int index(QString a=QString("500"),QString b=QString(),QString c=QString(),QString d=QString(),
 			QString e=QString(),QString f=QString(),QString g=QString())
                         {
-			echo()<<"Status: 404 NOT FOUND\r\nContent-Type: text/html; charset=utf-8\r\n\r\n";
 			echo()<<"shits<br/>"
 			"error "<<a<<"<br/>"
 			<<b<<"<br/>"
 
 int main(int argc, char *argv[])
 	{
-	QxtScgiApplication app(argc, argv);
+	QCoreApplication app(argc, argv);
+	QxtWebCore core;
+	core.listen(4000);
 	test t;
 	err e;
-	return app.exec(4000);
+	return app.exec();
 	}