@@ -6141,15 +6141,17 @@ TEST_F(ProjMgrUnitTests, TestRestrictedContextsWithContextSet_Pass) {
61416141}
61426142
61436143TEST_F (ProjMgrUnitTests, ValidateCreatedFor) {
6144- const vector<tuple<string, string, bool >> testData = {
6145- {
" [email protected] " ,
" error" ,
false },
6146- {
" [email protected] " ,
" warning" ,
true },
6147- {
" [email protected] " ,
" " ,
true },
6148- { " " , " " , true },
6149- { " Unknown" , " warning" , true },
6144+ const vector<tuple<string, bool , string, bool >> testData = {
6145+ {
" [email protected] " ,
true ,
" warning" ,
true },
6146+ {
" [email protected] " ,
false ,
" error" ,
false },
6147+ {
" [email protected] " ,
false ,
" warning" ,
true },
6148+ {
" [email protected] " ,
false ,
" " ,
true },
6149+ { " " , false , " " , true },
6150+ { " Unknown" , false , " warning" , true },
61506151 };
61516152 StdStreamRedirect streamRedirect;
6152- for (const auto & [createdFor, expectedMsg, expectedReturn] : testData) {
6153+ for (const auto & [createdFor, rpcMode, expectedMsg, expectedReturn] : testData) {
6154+ m_rpcMode = rpcMode;
61536155 streamRedirect.ClearStringStreams ();
61546156 EXPECT_EQ (expectedReturn, ValidateCreatedFor (createdFor));
61556157 auto errMsg = streamRedirect.GetErrorString ();
@@ -6165,14 +6167,15 @@ TEST_F(ProjMgrUnitTests, FailCreatedFor) {
61656167 char * argv[5 ];
61666168 StdStreamRedirect streamRedirect;
61676169 const string& csolution = testinput_folder + " /TestSolution/created-for.csolution.yml" ;
6168- const string& expectedErrMsg = " error csolution: solution requires newer CMSIS-Toolbox version 9.9.9" ;
6170+ const string& expectedErrMsg = " error csolution: the 'created-for' node in file .*created-for\\ .csolution\\ .yml\
6171+ specifies a minimum version 9\\ .9\\ .9 which is higher than .* of the used CMSIS-Toolbox manifest\n " ;
61696172 argv[1 ] = (char *)" convert" ;
61706173 argv[2 ] = (char *)csolution.c_str ();
61716174 argv[3 ] = (char *)" --output" ;
61726175 argv[4 ] = (char *)testoutput_folder.c_str ();
61736176 EXPECT_EQ (1 , RunProjMgr (5 , argv, 0 ));
61746177 auto errMsg = streamRedirect.GetErrorString ();
6175- EXPECT_NE (string::npos, errMsg. find (expectedErrMsg));
6178+ EXPECT_TRUE ( regex_match (errMsg, regex (expectedErrMsg) ));
61766179}
61776180
61786181TEST_F (ProjMgrUnitTests, RunProjMgr_FailedConvertShouldCreateRteDirInProjectFolder) {
0 commit comments