@@ -122,11 +122,15 @@ class WorkspacePropertyTest : public CxxTest::TestSuite {
122
122
// valid
123
123
TS_ASSERT_EQUALS (wsp2->setValue (" ws2" ), " " );
124
124
TS_ASSERT_EQUALS (wsp2->isValid (), " " );
125
- // Setting an invalid name should make wsp6 invalid
125
+
126
+ // Setting an invalid name should make wsp6 invalid but currently only in debug mode.
126
127
std::string invalidWorkspaceName = " ws6-1" ;
127
- std::string error =
128
+ std::string error = " " ;
129
+ #ifndef NDEBUG
130
+ error =
128
131
" Invalid object name '" + invalidWorkspaceName +
129
132
" '. Names must start with a letter or underscore and contain only alpha-numeric characters and underscores." ;
133
+ #endif
130
134
TS_ASSERT_EQUALS (wsp6->setValue (invalidWorkspaceName), error);
131
135
TS_ASSERT_EQUALS (wsp6->isValid (), error);
132
136
@@ -351,17 +355,19 @@ class WorkspacePropertyTest : public CxxTest::TestSuite {
351
355
void test_trimmming_off () {
352
356
Workspace_sptr ws = WorkspaceFactory::Instance ().create (" WorkspacePropertyTest" , 1 , 1 , 1 );
353
357
std::string wsNameWithWhitespace = " space1\t\n " ;
354
- AnalysisDataService::Instance ().add (" space1 " , ws);
358
+ AnalysisDataService::Instance ().add (wsNameWithWhitespace , ws);
355
359
WorkspaceProperty<Workspace> p (" workspace1" , " " , Direction::Input);
356
360
// turn trimming off
357
361
p.setAutoTrim (false );
358
362
359
- std::string expectedError =
363
+ std::string expectedError = " " ;
364
+ #ifndef NDEBUG
365
+ expectedError =
360
366
" Invalid object name '" + wsNameWithWhitespace +
361
367
" '. Names must start with a letter or underscore and contain only alpha-numeric characters and underscores." ;
362
-
363
- // setValue() should return an error string if illegal workspace name is provided.
364
- TS_ASSERT_EQUALS (p.setValue (wsNameWithWhitespace), " expectedError" );
368
+ # endif
369
+ // setValue() should return an error string in debug mode if illegal workspace name is provided.
370
+ TS_ASSERT_EQUALS (p.setValue (wsNameWithWhitespace), expectedError);
365
371
366
372
AnalysisDataService::Instance ().clear ();
367
373
}
0 commit comments