~aacid/unity-api/use_qenum

« back to all changes in this revision

Viewing changes to test/gtest/unity/util/IniParser/IniParser_test.cpp

  • Committer: Bileto Bot
  • Author(s): Marcus Tomlinson
  • Date: 2016-11-23 12:10:19 UTC
  • mfrom: (253.2.3 trunk)
  • Revision ID: ci-train-bot@canonical.com-20161123121019-c07o8dst1e6ysp8z
Don't rely on glib error message strings in IniParser_test (LP: #1642673)

Approved by: Daniel d'Andrada, Unity8 CI Bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
    }
149
149
    catch (const LogicException& e)
150
150
    {
151
 
        EXPECT_NE(string::npos, string(e.what()).find("Key file does not have group 'foo'"));
 
151
        EXPECT_NE(string::npos, string(e.what()).find("unity::LogicException: Could not get string value"));
 
152
        EXPECT_NE(string::npos, string(e.what()).find("group: foo"));
152
153
    }
153
154
    try
154
155
    {
156
157
    }
157
158
    catch (const LogicException& e)
158
159
    {
159
 
        EXPECT_NE(string::npos, string(e.what()).find("Key file does not have group 'foo'"));
 
160
        EXPECT_NE(string::npos, string(e.what()).find("unity::LogicException: Could not get localized string value"));
 
161
        EXPECT_NE(string::npos, string(e.what()).find("group: foo"));
160
162
    }
161
163
    try
162
164
    {
164
166
    }
165
167
    catch (const LogicException& e)
166
168
    {
167
 
        EXPECT_NE(string::npos, string(e.what()).find("Key file does not have group 'foo'"));
 
169
        EXPECT_NE(string::npos, string(e.what()).find("unity::LogicException: Could not get integer value"));
 
170
        EXPECT_NE(string::npos, string(e.what()).find("group: foo"));
168
171
    }
169
172
    try
170
173
    {
172
175
    }
173
176
    catch (const LogicException& e)
174
177
    {
175
 
        EXPECT_NE(string::npos, string(e.what()).find("Key file contains key 'doublevalue' in group 'first' which has a value that cannot be interpreted."));
 
178
        EXPECT_NE(string::npos, string(e.what()).find("unity::LogicException: Could not get integer value"));
 
179
        EXPECT_NE(string::npos, string(e.what()).find("group: first"));
176
180
    }
177
181
    try
178
182
    {
180
184
    }
181
185
    catch (const LogicException& e)
182
186
    {
183
 
        EXPECT_NE(string::npos, string(e.what()).find("Key file does not have group 'foo'"));
 
187
        EXPECT_NE(string::npos, string(e.what()).find("unity::LogicException: Could not get boolean value"));
 
188
        EXPECT_NE(string::npos, string(e.what()).find("group: foo"));
184
189
    }
185
190
    try
186
191
    {
188
193
    }
189
194
    catch (const LogicException& e)
190
195
    {
191
 
        EXPECT_NE(string::npos, string(e.what()).find("Value 'foo' cannot be interpreted as a number."));
 
196
        EXPECT_NE(string::npos, string(e.what()).find("unity::LogicException: Could not get integer array"));
 
197
        EXPECT_NE(string::npos, string(e.what()).find("group: first"));
192
198
    }
193
199
    try
194
200
    {
196
202
    }
197
203
    catch (const LogicException& e)
198
204
    {
199
 
        EXPECT_NE(string::npos, string(e.what()).find("Value '4.5' cannot be interpreted as a number."));
 
205
        EXPECT_NE(string::npos, string(e.what()).find("unity::LogicException: Could not get integer array"));
 
206
        EXPECT_NE(string::npos, string(e.what()).find("group: second"));
200
207
    }
201
208
    try
202
209
    {
204
211
    }
205
212
    catch (const LogicException& e)
206
213
    {
207
 
        EXPECT_NE(string::npos, string(e.what()).find("Value 'foo' cannot be interpreted as a boolean."));
 
214
        EXPECT_NE(string::npos, string(e.what()).find("unity::LogicException: Could not get boolean array"));
 
215
        EXPECT_NE(string::npos, string(e.what()).find("group: first"));
208
216
    }
209
217
}
210
218