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
Wide space input support #574
base: master
Are you sure you want to change the base?
Conversation
Also thanks for your pull requests. Also, as started, the tests are missing. Perhaps you want to add them to the pull request? Also, the try/catch isn't going to get accepted like that. We avoid using exception handling, except in specific places (and then only when providing an alternative) |
Hmm, adding that tests isn't exactly trivial. The moment I add a test that actually uses the "RunAllTests" public interface I get access violations in the memory leak reporting. I get the impression it is interfering with itself as it seems it runs itself for these commandlinetestrunner tests. I suspect this explains why the following test is thus missing:
So I guess this means I can't test the complete function but have to do with extracting the conversion from wide and adding a test for that. |
Maybe make your test more like the existing ones, e.g. const char* argv[] = { "dummy.exe", "-fdskjnfkds" };
CommandLineTestRunner commandLineTestRunner(2, argv, &output, ®istry);
commandLineTestRunner.runAllTestsMain(); Also, maybe look at CommandLineArgumentsTest. |
No, because that is already at a level that everything is normal characters. I only added a top level that transforms from wide to normal such that that level can stay the same. |
oeps, wrong button |
I was actually wondering that in your test you declare the args as const char*? |
I mirrored the const/not constness of the normal char RunAllTests functions where the actual code is also in the const arguments version. From that, and that the argumenets are only read, follows that the input of the conversion function is also a const. |
Well, it looks at Travis like I still have some crossplatform compatibility work to do... |
I meant char as opposed to wchar_t, sorry. |
I also meant passing in the address of |
The test I placed here was more about signalling a problem trying to test the top level function before any of my changes so still with the normal chars. And that passing is only possible one level lower that I am not touching and also using from the wide top level functions. |
Ok, I have an error on Travis CI that I don't get and my colleague's have no idea either. But we normally program for Windows (CE5/7) /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu/bits/os_defines.h:40:10: fatal error: |
Hmm, the wchar_t does raises some questions on support on embedded platforms. @arstrube do you know the cl2000 support of wchart_t? I assume wchar_t is one of the first things to go? |
@@ -32,6 +32,7 @@ | |||
#include "TestOutput.h" | |||
#include "CommandLineArguments.h" | |||
#include "TestFilter.h" | |||
#include <cwchar> |
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.
Direct dependencies with Lib C aren't allowed in CppUTest. You'd need to wrap the methods in PlatformSpecific to deal with portability to "less supported" platforms.
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.
Ah, that makes sense.
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.
@basvodde I don't know offhand about wchar_t. What I do know is that, due to limited memory, we had to use the non-std-C++ lib option. I suppose that means at least the conversion functions won't be available for the cl2000.
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.
seems to be a c lib though.
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.
Yeah, though we are going to have problems with wchar_t not being a type without #include...
Well as I was adding this one as a sidenote while fixing the verbose junit combinetion I can't invest to much time in this. I am getting the feeling I'd better move the conversion to our mains and be done with it. An interesting experience though, discovering the details to keep in mind. But something I rather not work on with only a continuous integration server to verify with. |
@WilcoBT Though, I like to have wchar_t support... I'm wondering whether we should. Would you mind explaining a bit how you ended up implementing it, so that we can understand why it was needed. The reason for this is:
If the reason for adding these is worth the effort, I'm definitively for it. Just want to reflect on that before continuing... |
I didn't implement it. I found it in our local git clone. But the reason it was added it because we have test suites for multiple repositories(a shared and a few products). Practically each such suite is build in visual studio with unicode support which automagically gives the arguments in wchars. |
@WilcoBT putting it into your own main() is an excellent idea in your case. We have set up all our tests suites to share the same main() ;-) There need not be any code duplication that way. We have put our CppUTestMain.cpp into a the folder above the CppUTest lib and headers, but anywhere is fine. |
no, multiple mains :) one per repository |
P.S. Just that VS likes putting a main() in when you create a new project doesn't mean it has to be there. You can safely delete all those and then add the one and only main that contains your wide character support. |
So, what do we do with the wchar_t support? need it? Decline as we don't want the additional dependencies? We could just leave it open for now and see if other people would want it? |
Due to internationalisation, everything here has to go in wide characters. I discovered an uncommited change floating around here to run tests with wide character parameter input support that might be useful here as well.