MCPcopy Create free account
hub / github.com/dds-bridge/dds / real_main

Function real_main

library/tests/testcommon.cpp:64–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62
63
64int real_main([[maybe_unused]] int argc, [[maybe_unused]] char * argv[])
65{
66 bool GIBmode = false;
67
68 int stepsize = 0;
69 if (options.solver_ == Solver::DTEST_SOLVER_SOLVE)
70 stepsize = MAXNOOFBOARDS;
71 else if (options.solver_ == Solver::DTEST_SOLVER_CALC)
72 stepsize = MAXNOOFTABLES;
73 else if (options.solver_ == Solver::DTEST_SOLVER_PLAY)
74 stepsize = MAXNOOFBOARDS;
75 else if (options.solver_ == Solver::DTEST_SOLVER_PAR)
76 stepsize = 1;
77 else if (options.solver_ == Solver::DTEST_SOLVER_DEALERPAR)
78 stepsize = 1;
79
80 set_constants();
81 main_identify();
82
83 int number = 0;
84 int * dealer_list = nullptr;
85 int * vul_list = nullptr;
86 DealPBN * deal_list = nullptr;
87 FutureTricks * fut_list = nullptr;
88 DdTableResults * table_list = nullptr;
89 ParResults * par_list = nullptr;
90 ParResultsDealer * dealerpar_list = nullptr;
91 PlayTracePBN * play_list = nullptr;
92 SolvedPlay * trace_list = nullptr;
93 if (read_file(options.fname_, number, GIBmode, &dealer_list, &vul_list,
94 &deal_list, &fut_list, &table_list, &par_list, &dealerpar_list,
95 &play_list, &trace_list) == false)
96 {
97 cout << "read_file failed\n";
98 exit(0);
99 }
100
101 if (GIBmode && options.solver_ != Solver::DTEST_SOLVER_CALC)
102 {
103 cout << "GIB file only works with calc\n";
104 exit(0);
105 }
106
107 timer.reset();
108 timer.set_name("Hand stats");
109
110 BoardsPBN bop;
111 SolvedBoards solvedbdp;
112 DdTableDealsPBN dealsp;
113 DdTablesRes resp;
114 AllParResults parp;
115 PlayTracesPBN playsp;
116 SolvedPlays solvedplp;
117
118 if (options.solver_ == Solver::DTEST_SOLVER_SOLVE)
119 {
120 loop_solve(&bop, &solvedbdp, deal_list, fut_list, number, stepsize);
121 }

Callers 1

mainFunction · 0.85

Calls 14

set_constantsFunction · 0.85
main_identifyFunction · 0.85
read_fileFunction · 0.85
loop_solveFunction · 0.85
loop_calcFunction · 0.85
loop_playFunction · 0.85
loop_parFunction · 0.85
loop_dealerparFunction · 0.85
set_nameMethod · 0.80
print_handsMethod · 0.80
GetBoardTimesMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected