MCPcopy Create free account
hub / github.com/ddnet/ddnet / main

Function main

src/tools/map_test.cpp:82–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82int main(int argc, const char **argv)
83{
84 const CCmdlineFix CmdlineFix(&argc, &argv);
85 log_set_global_logger_default();
86
87 const char *pMap;
88 bool CalcHashes;
89 if(argc == 2)
90 {
91 pMap = argv[1];
92 CalcHashes = false;
93 }
94 else if(argc == 3 && str_comp(argv[1], "--calc-hashes") == 0)
95 {
96 pMap = argv[2];
97 CalcHashes = true;
98 }
99 else
100 {
101 log_error(TOOL_NAME, "Usage: %s [--calc-hashes] <map>", TOOL_NAME);
102 return -1;
103 }
104
105 std::unique_ptr<IStorage> pStorage = std::unique_ptr<IStorage>(CreateStorage(IStorage::EInitializationType::BASIC, argc, argv));
106 if(!pStorage)
107 {
108 log_error(TOOL_NAME, "Error creating basic storage");
109 return -1;
110 }
111
112 return TestMap(pMap, CalcHashes, pStorage.get());
113}

Callers

nothing calls this directly

Calls 5

str_compFunction · 0.85
CreateStorageFunction · 0.85
TestMapFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected