Revision 1491 trunk/tests/gtests/test_scalefactor.cpp

test_scalefactor.cpp (revision 1491)
1 1
#include <gtest/gtest.h>
2
#include <admodel.h>
3
#include <contrib.h>
4 2
#include <df1b2fun.h>
5
#include <adrndeff.h>
6
#include "scalefactor.htp"
7 3

  
8
extern "C"  {
9
  void ad_boundf(int i);
10
}
11
extern long int arrmblsize;
12

  
13 4
class test_scalefactor: public ::testing::Test {};
14 5

  
15 6
TEST_F(test_scalefactor, run)
16 7
{
17
  int scalefactor(int argc, char* argv[]);
18
  //scalefactor(argc, argv);
19
}
8
  adpool* save = df1b2variable::pool;
9
  df1b2variable::pool = 0;
10
  {
11
    adpool pool;
12
    df1b2variable::pool = &pool;
20 13

  
21
TEST_F(test_scalefactor, run2)
22
{
23
  ad_set_new_handler();
24
  ad_exit=&ad_boundf;
25
  gradient_structure::set_NO_DERIVATIVES();
26
  gradient_structure::set_YES_SAVE_VARIABLES_VALUES();
27
#if defined(__GNUDOS__) || defined(DOS386) || defined(__DPMI32__)  || defined(__MSVC32__)
28
  if (!arrmblsize) arrmblsize=150000;
29
#else
30
  if (!arrmblsize) arrmblsize=25000;
31
#endif
32
  int argc = 1;
33
  char* argv[] = { (char*)"./scalefactor" };
14
    int argc = 1;
15
    char* argv[] = { (char*)"./scalefactor" };
34 16

  
35
  df1b2variable::noallocate=1;
36
  df1b2_parameters mp(arrmblsize,argc,argv);
37
  mp.iprint=10;
17
    int scalefactor(int argc, char* argv[]);
18
    scalefactor(argc, argv);
38 19

  
39
  function_minimizer::random_effects_flag=1;
40
  df1b2variable::noallocate=0;
41
  mp.preliminary_calculations();
42
  mp.userfunction();
43

  
44
  //mp.computations(argc,argv);
20
    df1b2variable::pool = 0;
21
  }
22
  df1b2variable::pool = save;
45 23
}

Also available in: Unified diff