Revision 1491

trunk/tests/gtests/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
}
trunk/tests/gtests/Makefile (revision 1491)
8 8
 test_dlist.cpp\
9 9
 test_ad_comm.cpp\
10 10
 test_df1b2atan2.obj\
11
 df1b2atan2.obj\
11 12
 test_gradient_structure.cpp\
12 13
 test_df_file.cpp\
13 14
 test_scalefactor.obj\
15
 scalefactor.obj\
14 16
 main.cpp
15 17

  
16 18
all: clean gtest-all
......
28 30
scalefactor.obj: scalefactor.tpl
29 31
	CXXFLAGS="-Dmain=scalefactor" ../../admb -c -r -g $^
30 32

  
31
#gtest-all: gtest-all.obj df1b2atan2.obj scalefactor.obj $(GTESTS)
32
gtest-all: gtest-all.obj main.cpp test_scalefactor.obj scalefactor.obj
33
gtest-all: gtest-all.obj $(GTESTS)
34
#gtest-all: gtest-all.obj main.cpp test_scalefactor.obj scalefactor.obj
33 35
	CXXFLAGS=-I$(GTEST_DIR)/include ../../admb -g -r $^
34 36

  
35 37
gtest-all.obj: googletest-read-only
......
62 64
	@rm -vf admodel.hes
63 65
	@rm -vf hesscheck
64 66
	@rm -vf hessian.bin
65

  
67
	@rm -vf scalefactor.bar
68
	@rm -vf scalefactor.bgs
69
	@rm -vf scalefactor.cor
70
	@rm -vf scalefactor.eva
71
	@rm -vf scalefactor.luu
72
	@rm -vf scalefactor.par
73
	@rm -vf scalefactor.rhes
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff