int tester()
{
  Compta::Operation op11("1.1",12.00,1.0,false,20120502,20201231);
  Compta::Operation op12("1.2",120.00,10.0,false,20120502,20201231);
  Compta::ForecastContainer<Compta::Operation> cat1;
  cat1.set_name("cat1");
  cat1.add_operation(op11);//cat 1, amount = 12.00, margin is 11.00

  Compta::Operation op21("2.1",150.00,1.00,false,20120502,20201231);
  Compta::Operation op22("2.2",950.00,2.00,false,20120502,20201231);
  Compta::Operation op23("2.3",275.56,3.00,false,20120502,20201231);
  Compta::ForecastContainer<Compta::Operation> cat2;
  cat2.set_name("cat2");
  cat2.add_operation(op21);
  cat2.add_operation(op22);
  cat2.add_operation(op23);//cat 2, amount = 1375.56, margin = 6.00

  Compta::Forecast forecast;
  forecast.add_forecast_category(cat1);
  forecast.add_forecast_category(cat2); 
  forecast.add_operation("cat1",op12);//amount is 1507.56, margin is 17.00
  forecast.set_currency(Compta::Currency::EUR);
  Compta::Forecast copy_forecast(forecast);
  
  int return_flag(0);

  return_flag = return_flag || check_cat(forecast.forecast().operations_list()[0],"cat1",132.00,11.02,2," in category 1")
                            || check_cat(forecast.forecast().operations_list()[1],"cat2",1375.56,6.00,3," in category 2")
                            || check_cat(forecast.forecast(),"forecast",1507.56,17.00,2," in forecast")
                            || check((forecast.currency() == Compta::Currency::EUR),"forecast currency");
  return_flag = return_flag || check_cat(copy_forecast.forecast(),"forecast",1507.56,17.00,2," in copy forecast")
                            || check((copy_forecast.currency() == Compta::Currency::EUR),"copy forecast currency");



  return return_flag;
}
Exemple #2
0
 op   (0x03, lsr)
 op   (0x04, rol)
 op   (0x05, bra)
 op   (0x06, blt)
 op   (0x07, bge)
 op   (0x08, bne)
 op   (0x09, beq)
 op   (0x0a, bpl)
 op   (0x0b, bmi)
 op   (0x0c, bcc)
 op   (0x0d, bcs)
 op   (0x0e, bvc)
 op   (0x0f, bvs)
 op16 (0x10, to_r)
 op16 (0x20, with_r)
 op12 (0x30, stw_ir)
 op   (0x3c, loop)
 op   (0x3d, alt1)
 op   (0x3e, alt2)
 op   (0x3f, alt3)
 op12 (0x40, ldw_ir)
 op   (0x4c, plot)
 op   (0x4d, swap)
 op   (0x4e, color)
 op   (0x4f, not)
 op16 (0x50, add_r)
 op16 (0x60, sub_r)
 op   (0x70, merge)
 op15h(0x71, and_r)
 op16 (0x80, mult_r)
 op   (0x90, sbk)