From 815ad7ce6e7b129c52891446d1ecf10390b34dac Mon Sep 17 00:00:00 2001 From: JasperVanEck Date: Thu, 28 Nov 2013 10:02:43 +0100 Subject: Moved tests to Examples --- tests/Makefile | 5 -- tests/simple/Makefile | 22 ------ tests/simple/simple.cpp | 184 ------------------------------------------------ tests/simple/simple.php | 99 -------------------------- 4 files changed, 310 deletions(-) delete mode 100644 tests/Makefile delete mode 100644 tests/simple/Makefile delete mode 100644 tests/simple/simple.cpp delete mode 100644 tests/simple/simple.php (limited to 'tests') diff --git a/tests/Makefile b/tests/Makefile deleted file mode 100644 index 2f74b32..0000000 --- a/tests/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -all: - cd simple; $(MAKE) - -clean: - cd simple; $(MAKE) clean diff --git a/tests/simple/Makefile b/tests/simple/Makefile deleted file mode 100644 index e60be3a..0000000 --- a/tests/simple/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -CPP = g++ -RM = rm -f -CPP_FLAGS = -Wall -c -I. -O2 -std=c++11 - -LD = g++ -LD_FLAGS = -Wall -shared -O2 -RESULT = simple.so - -SOURCES = $(wildcard *.cpp) -OBJECTS = $(SOURCES:%.cpp=%.o) - -all: ${OBJECTS} ${RESULT} - -${RESULT}: ${OBJECTS} - ${LD} ${LD_FLAGS} -o $@ ${OBJECTS} -lphpcpp - -clean: - ${RM} *.obj *~* ${OBJECTS} ${RESULT} - -${OBJECTS}: - ${CPP} ${CPP_FLAGS} -fpic -o $@ ${@:%.o=%.cpp} - diff --git a/tests/simple/simple.cpp b/tests/simple/simple.cpp deleted file mode 100644 index 7942a3c..0000000 --- a/tests/simple/simple.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Simple.h - * - * A very simple extension that does almost nothing - * - * @author Emiel Bruijntjes - * @copyright 2013 Copernica BV - */ -#include -#include -#include - -/** - * Namespace to use - */ -using namespace std; - - -Php::Value bubblesort(Php::Parameters ¶ms) -{ - cout << "start bubblesort" << endl; - - // the array that was passed - Php::Value array(params[0]); - - cout << "go return" << endl; - - return array; - - // size of the array - int size = array.size(); - - cout << "convert to native" << endl; - - int *x = new int[size]; - for (int i=0; i x(&MyCustomClass::myMethod); - - // define classes - extension.add("my_class", Php::Class({ - Php::Public("a", 123), - Php::Protected("b", "abc"), - Php::Protected("myMethod", Php::Method(&MyCustomClass::myMethod)), - Php::Public("__construct", Php::Method(&MyCustomClass::__construct)) - })); - - // return the module entry - return extension.module(); - } -} - diff --git a/tests/simple/simple.php b/tests/simple/simple.php deleted file mode 100644 index 3abaa77..0000000 --- a/tests/simple/simple.php +++ /dev/null @@ -1,99 +0,0 @@ -a."\n"); -// echo($this->b."\n"); -// echo("hoi\n"); -// -// parent::myMethod($val); -// } -// -//} -// -//$x = new my_extended_class(); -//$x->myMethod(123); - -$x = new my_class(); -$x->myMethod(); - - -//echo(my_plus(1,2,3,4)."\n"); - -$array = array(); -for ($i=0; $i<10000; $i++) $array[] = rand(); - -//$array = array(1,2,3); - -//print_r($array); -//bubblesort($array); - -//print_r($array); - - -//echo("my_class::a = ".$x->a."\n"); -//echo("my_class::b = ".$x->b."\n"); -// -//unset($x); -// -//echo("done\n"); - -//$x->my_method(); - - -- cgit v1.2.3