/*************************************************************************/
/*                                                                       */
/*                                                                       */
/*  File      : ValueTest.cpp                                            */
/*  Author    : Volker H. Simonis  (simonis@informatik.uni-tuebingen.de) */
/*  Copyright : Volker H. Simonis  (simonis@informatik.uni-tuebingen.de) */
/*  Date      : Wed Oct 21 12:11:50 MEST 1998                            */
/*                                                                       */
/*  Compile with :                                                       */
/*     EDG  : eccp -x -B -tlocal ValueTest.cpp                           */
/*     EGCS : eg++ ValueTest.cpp                                         */
/*                                                                       */
/*  Purpose : test for chamelean Objects (class Value)                   */
/*                                                                       */
/*  Output  : produeced with EDG                                         */
/*                                                                       */
/*            main()                                                     */
/*            sizeof(Value) = 24                                         */
/*            hallo, 123456, 999.999                                     */
/*            hallo, 123456, 123456, 999.999                             */
/*            Incompatible_Type_Exeption : type (long)                   */
/*            hallo, 123456, 123456, hallo                               */
/*                                                                       */
/*************************************************************************/

#include "Value.hpp"

using namespace std;
using namespace wsi;

int main() {
  cout << "main()\n";
  cout << "sizeof(Value) = " << sizeof(Value) << endl;
  
  Value t;
  Value tt(123456);
  Value ttt(999.999);
  t = (string)"hallo";
  
  cout << t << ", " << tt << ", " << ttt << endl;

  string s = t;
  int i = tt;
  double d;
  if (ttt.typeId() == typeid(d)) d = ttt;
  ttt = tt;             // assignement operator
  int ii = ttt;
  cout << s << ", " << i << ", " << ii << ", " << d << endl;

  try {
    long l = tt;
  } catch (Incompatible_Type_Exception& e) {
    cout << "Incompatible_Type_Exeption : type (" << e.getError() << ")\n";
  }

  Value tttt(t);        // copy constructor

  cout << t << ", " << tt << ", " << ttt << ", " << tttt << endl;

  return 0;
}
