Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Multiple auto_incomplete files generated

LegacyForum
LegacyForum Posts: 1,664 ✭✭
(Entered for David Mann)

I just observed this when preparing the previous issue. When I added the default constructor for AdjacentChannels, I noticed that I now have two auto_incomplete functions auto_incomplete_6b7324ea.cpp which contains the original stubs and auto_incomplete_2f8f39d7.cpp which hold the new constructor stub. This is currently a concern issue...How come it did that and should I expect that over time it will just continue to make more and more of these auto_incomplete files? What I did was added the default constructor, in the public sectiion for AdjacentChannels the executed the GenerateUnitTests followed by GenerateStubs. This could be come an issue over time because we would have to maintain all these files under CM. Here is some of the attempts I made to resolving this. I took the functions generated the other auto_incomplete file and copied them to the original. I then removed the newly added auto_incomplete file and re-executed GenerateUnitTests followed by GenerateStubs. This seemed to work. Then, feeling confident with my success, I said to myself, these names auto_incomplete_<random looking number> would look better if I could name them something specific. So I renamed the file from to auto_incomplete_parasoft.cpp. I then re-executed GenerateUnitTests followed by GenerateStubs and got the following error:
auto_incomplete_parasoft.cpp
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(15) : error C2039: 'CppTest_Auto_Dummy' : is not a member of 'operator``global namespace'''
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(15) : error C2065: 'CppTest_Auto_Dummy' : undeclared identifier
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(15) : error C2146: syntax error : missing ')' before identifier '__CPTR_stub_ctor_param'
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(15) : error C2761: '__ctor' : member function redeclaration not allowed
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(15) : error C2059: syntax error : ')'
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(16) : error C2143: syntax error : missing ';' before '{'
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(16) : error C2447: '{' : missing function header (old-style formal list?)
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(21) : error C2039: 'CppTest_Auto_Stub_BlaBla' : is not a member of 'AdjacentChannels'
c:\MYDATA\UAV\OFP\APPL\Common\inc\AdjacentChannels.h(6) : see declaration of 'AdjacentChannels'
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(28) : error C2039: 'CppTest_Auto_Stub_destructor' : is not a member of 'SoftApplication'
c:\MYDATA\UAV\OFP\APPL\Common\inc\SoftApplication.h(7) : see declaration of 'SoftApplication'
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(34) : error C2039: 'CppTest_Auto_Stub_addApplication' : is not a member of 'SoftChannel'
c:\MYDATA\UAV\OFP\APPL\Common\inc\SoftChannel.h(9) : see declaration of 'SoftChannel'
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(40) : error C2146: syntax error : missing ')' before identifier '__CPTR_stub_ctor_param'
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(40) : error C2761: '__ctor' : member function redeclaration not allowed
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(40) : error C2059: syntax error : ')'
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(41) : error C2143: syntax error : missing ';' before '{'
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(41) : error C2447: '{' : missing function header (old-style formal list?)
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(46) : error C2146: syntax error : missing ')' before identifier '__CPTR_stub_ctor_param'
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(46) : error C2761: '__ctor' : member function redeclaration not allowed
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(46) : error C2059: syntax error : ')'
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(47) : error C2143: syntax error : missing ';' before '{'
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(47) : error C2447: '{' : missing function header (old-style formal list?)
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(52) : error C2039: 'CppTest_Auto_Stub_destructor' : is not a member of 'SoftChannel'
c:\MYDATA\UAV\OFP\APPL\Common\inc\SoftChannel.h(9) : see declaration of 'SoftChannel'
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(53) : error C2084: function 'void CppTest_Auto_Stub_destructor(void)' already has a body
c:\MYDATA\UAV\Build\Visual C++\OFP\MAIN\stubs\autogenerated\auto_incomplete_parasoft.cpp(28) : see previous definition of 'CppTest_Auto_Stub_destructor'
Process exited with code: 2 (error).
...failed.
"Generate Stubs" (Execution) for UAV\MAIN finished with error(s). Examine the log above for details.
At that point I realized the the auto_incomplete_<some random_number> must be associated somewhere else. Is it possible to rename auto_incomplete_...? What I was thinking was that as more auto_incomplete_... files crop up in the folder I could append them to a nicely named auto_incomplete_... file name and then remove them auto_incomplete_<some random number> file. This would help standardize the file name and allow for easier Configuration management.