-
Notifications
You must be signed in to change notification settings - Fork 531
Wide space input support #574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,29 +69,34 @@ int CommandLineTestRunner::RunAllTests(int ac, const char** av) | |
| return result; | ||
| } | ||
|
|
||
| int CommandLineTestRunner::RunAllTests( int ac, wchar_t** av ) | ||
| int CommandLineTestRunner::RunAllTests( int ac, wchar_t** av ) { | ||
| return RunAllTests( ac, const_cast<const wchar_t**> ( av ) ); | ||
| } | ||
|
|
||
| int CommandLineTestRunner::RunAllTests( int ac, const wchar_t** av ) | ||
| { | ||
| char** avc = new char*[ac]; | ||
| for ( int i = 0; i < ac; i++ ) { | ||
| size_t len = wcslen( av[i] ) + 1; | ||
| avc[i] = new char[len]; | ||
| wcstombs_s( 0 , avc[i], sizeof(char)*len, av[i], len ); | ||
| } | ||
| int result = 0; | ||
| char** avc = ConvertWideArgumentsToNormal( ac, av ); | ||
|
|
||
| try { | ||
| RunAllTests( ac, avc ); | ||
| } | ||
| catch ( ... ) { | ||
| } | ||
| int result = RunAllTests( ac, avc ); | ||
|
|
||
| for ( int i = 0; i < ac; i++ ) { | ||
| delete[] avc[i]; | ||
| } | ||
| delete[] avc; | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| char** CommandLineTestRunner::ConvertWideArgumentsToNormal( int ac, const wchar_t** av ) { | ||
| char** avc = new char*[ac]; | ||
| for( int i = 0; i < ac; i++ ) { | ||
| size_t len = wcslen( av[i] ) + 1; | ||
| avc[i] = new char[len]; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having the new here and the delete at another scope is asking for trouble :( |
||
| wcstombs( avc[i], av[i], len ); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The conversion methods of Lib C would need to be in PlatformSpecific...
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting challenge considering the lack of experience and access to half the current platforms. |
||
| } | ||
| return avc; | ||
| } | ||
|
|
||
| int CommandLineTestRunner::runAllTestsMain() | ||
| { | ||
| int testResult = 0; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have the const, do we need the non-const?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For symmetry I think it would be best, although the char one might just be there for historical reasons that it was the first 'RunAllTests' function.