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/formula.cpp | 56 --------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 src/tests/formula.cpp (limited to 'src/tests/formula.cpp') diff --git a/src/tests/formula.cpp b/src/tests/formula.cpp deleted file mode 100644 index a90ddaf..0000000 --- a/src/tests/formula.cpp +++ /dev/null @@ -1,56 +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/formula.h" -#include - -int main( int argc, char *argv[] ) -{ - if( argc < 2 ) - { - printf("usage: %s \n", argv[0] ); - return -1; - } - Bu::Formula uForm; - Bu::Formula dForm; - - class DblCeilFunc : public Bu::Formula::Func - { - public: - virtual double operator()( double x ) - { - return ceil( x ); - } - }; - - dForm.hFunc.insert( "ceil", new DblCeilFunc() ); - - class IntCeilFunc : public Bu::Formula::Func - { - public: - virtual uint32_t operator()( uint32_t x ) - { - return x; - } - }; - - uForm.hFunc.insert( "ceil", new IntCeilFunc() ); - - uForm.hVars.insert("x", 10 ); - dForm.hVars.insert("x", 10.00 ); - uForm.hVars.insert("y", 10 ); - dForm.hVars.insert("y", 10.00 ); - - for( int j = 1; j < argc; j++ ) - { - printf("u: %s = %u\n", argv[j], uForm.run( argv[j] ) ); - printf("d: %s = %f\n", argv[j], dForm.run( argv[j] ) ); - } - - return 0; -} - -- cgit v1.2.3