00001 /*************************************************************************** 00002 Calculator.h - simple class for demonstration purposes 00003 00004 ------------------- 00005 begin : Sat 22 Jan 2005 00006 copyright : (C) 2002-2010 by Ewald Arnold 00007 email : mockpp at ewald-arnold dot de 00008 00009 $Id: Calculator.h 1491 2010-01-02 22:21:45Z ewald-arnold $ 00010 00011 ***************************************************************************/ 00012 00013 00014 static int global_error = 0; // disturb tests 00015 00019 class NetworkError {}; 00020 00025 class Calculator 00026 { 00027 public: 00028 00032 Calculator (int in_base) 00033 : base(in_base) 00034 {} 00035 00040 int add(int num) 00041 { 00042 return base + num + global_error; 00043 } 00044 00049 int sub(int num) 00050 { 00051 return base - num - global_error; 00052 } 00053 00054 private: 00055 00056 int base; 00057 }; 00058