trying to fix unittests

This commit is contained in:
Vadim Lopatin 2015-04-07 12:24:03 +03:00
parent d97cec9522
commit 9a1d35aa86
2 changed files with 24 additions and 27 deletions

View File

@ -72,7 +72,7 @@
<debuglevel>0</debuglevel> <debuglevel>0</debuglevel>
<debugids>DebugFocus FontResources</debugids> <debugids>DebugFocus FontResources</debugids>
<versionlevel>0</versionlevel> <versionlevel>0</versionlevel>
<versionids>EmbedStandardResources Unicode USE_FREETYPE USE_OPENGL</versionids> <versionids>EmbedStandardResources Unicode USE_FREETYPE USE_OPENGL USE_SDL</versionids>
<dump_source>0</dump_source> <dump_source>0</dump_source>
<mapverbosity>0</mapverbosity> <mapverbosity>0</mapverbosity>
<createImplib>1</createImplib> <createImplib>1</createImplib>

View File

@ -1237,24 +1237,13 @@ version (Windows) {
int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow) int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow)
{ {
initLogs(); //Log.d("myWinMain()");
Log.d("myWinMain()");
string basePath = exePath(); string basePath = exePath();
Log.i("Current executable: ", exePath()); //Log.i("Current executable: ", exePath());
string cmdline = fromStringz(lpCmdLine).dup; string cmdline = fromStringz(lpCmdLine).dup;
Log.i("Command line: ", cmdline); //Log.i("Command line: ", cmdline);
string[] args = splitCmdLine(cmdline); string[] args = splitCmdLine(cmdline);
Log.i("Command line params: ", args); //Log.i("Command line params: ", args);
if (!initFontManager()) {
Log.e("******************************************************************");
Log.e("No font files found!!!");
Log.e("Currently, only hardcoded font paths implemented.");
Log.e("Probably you can modify sdlapp.d to add some fonts for your system.");
Log.e("TODO: use fontconfig");
Log.e("******************************************************************");
assert(false);
}
return sdlmain(args); return sdlmain(args);
} }
@ -1265,6 +1254,14 @@ version (Windows) {
initLogs(); initLogs();
return sdlmain(args);
}
}
int sdlmain(string[] args) {
initLogs();
if (!initFontManager()) { if (!initFontManager()) {
Log.e("******************************************************************"); Log.e("******************************************************************");
Log.e("No font files found!!!"); Log.e("No font files found!!!");
@ -1275,11 +1272,7 @@ version (Windows) {
assert(false); assert(false);
} }
return sdlmain(args);
}
}
int sdlmain(string[] args) {
currentTheme = createDefaultTheme(); currentTheme = createDefaultTheme();
try { try {
@ -1331,7 +1324,11 @@ int sdlmain(string[] args) {
int res = 0; int res = 0;
version (unittest) {
} else {
res = UIAppMain(args); res = UIAppMain(args);
}
//Log.e("Widget instance count after UIAppMain: ", Widget.instanceCount()); //Log.e("Widget instance count after UIAppMain: ", Widget.instanceCount());
Log.d("Destroying SDL platform"); Log.d("Destroying SDL platform");