@@ -121,9 +121,7 @@ TEST_CASE("Arithmetic -> Subtraction -> Subtract purely imaginary numbers",
121
121
require_approx_equal (Complex (0.0 , -1.0 ), c1 - c2);
122
122
}
123
123
124
- TEST_CASE (
125
- " Arithmetic -> Subtraction -> Subtract numbers with real and imaginary "
126
- " part" ,
124
+ TEST_CASE (" Arithmetic -> Subtraction -> Subtract numbers with real and imaginary part" ,
127
125
" [f876feb1-f9d1-4d34-b067-b599a8746400]" ) {
128
126
const Complex c1{1.0 , 2.0 };
129
127
const Complex c2{3.0 , 4.0 };
@@ -147,9 +145,7 @@ TEST_CASE("Arithmetic -> Multiplication -> Multiply purely imaginary numbers",
147
145
require_approx_equal (Complex (-2.0 , 0.0 ), c1 * c2);
148
146
}
149
147
150
- TEST_CASE (
151
- " Arithmetic -> Multiplication -> Multiply numbers with real and imaginary "
152
- " part" ,
148
+ TEST_CASE (" Arithmetic -> Multiplication -> Multiply numbers with real and imaginary part" ,
153
149
" [4d1d10f0-f8d4-48a0-b1d0-f284ada567e6]" ) {
154
150
const Complex c1{1.0 , 2.0 };
155
151
const Complex c2{3.0 , 4.0 };
@@ -196,18 +192,14 @@ TEST_CASE("Absolute value -> Absolute value of a negative purely real number",
196
192
REQUIRE_THAT (c.abs (), Catch::Matchers::WithinAbs (5.0 , eps));
197
193
}
198
194
199
- TEST_CASE (
200
- " Absolute value -> Absolute value of a purely imaginary number with "
201
- " positive imaginary part" ,
195
+ TEST_CASE (" Absolute value -> Absolute value of a purely imaginary number with positive imaginary part" ,
202
196
" [bbe26568-86c1-4bb4-ba7a-da5697e2b994]" ) {
203
197
const Complex c{0.0 , 5.0 };
204
198
205
199
REQUIRE_THAT (c.abs (), Catch::Matchers::WithinAbs (5.0 , eps));
206
200
}
207
201
208
- TEST_CASE (
209
- " Absolute value -> Absolute value of a purely imaginary number with "
210
- " negative imaginary part" ,
202
+ TEST_CASE (" Absolute value -> Absolute value of a purely imaginary number with negative imaginary part" ,
211
203
" [3b48233d-468e-4276-9f59-70f4ca1f26f3]" ) {
212
204
const Complex c{0.0 , -5.0 };
213
205
@@ -266,90 +258,70 @@ TEST_CASE("Complex exponential function -> Exponential of a purely real number",
266
258
}
267
259
268
260
// Extra Credit
269
- TEST_CASE (
270
- " Complex exponential function -> Exponential of a number with real and "
271
- " imaginary part" ,
261
+ TEST_CASE (" Complex exponential function -> Exponential of a number with real and imaginary part" ,
272
262
" [08eedacc-5a95-44fc-8789-1547b27a8702]" ) {
273
263
const Complex c{std::log (2.0 ), M_PI};
274
264
275
265
require_approx_equal (Complex (-2.0 , 0.0 ), c.exp ());
276
266
}
277
267
278
- TEST_CASE (
279
- " Complex exponential function -> Exponential resulting in a number with "
280
- " real and imaginary part" ,
268
+ TEST_CASE (" Complex exponential function -> Exponential resulting in a number with real and imaginary part" ,
281
269
" [d2de4375-7537-479a-aa0e-d474f4f09859]" ) {
282
270
const Complex c{std::log (2.0 ) / 2.0 , M_PI / 4.0 };
283
271
284
272
require_approx_equal (Complex (1.0 , 1.0 ), c.exp ());
285
273
}
286
274
287
- TEST_CASE (
288
- " Operations between real numbers and complex numbers -> Add real number to "
289
- " complex number" ,
275
+ TEST_CASE (" Operations between real numbers and complex numbers -> Add real number to complex number" ,
290
276
" [06d793bf-73bd-4b02-b015-3030b2c952ec]" ) {
291
277
const Complex c{1.0 , 2.0 };
292
278
293
279
require_approx_equal (Complex (6.0 , 2.0 ), c + 5.0 );
294
280
}
295
281
296
- TEST_CASE (
297
- " Operations between real numbers and complex numbers -> Add complex number "
298
- " to real number" ,
282
+ TEST_CASE (" Operations between real numbers and complex numbers -> Add complex number to real number" ,
299
283
" [d77dbbdf-b8df-43f6-a58d-3acb96765328]" ) {
300
284
const Complex c{1.0 , 2.0 };
301
285
302
286
require_approx_equal (Complex (6.0 , 2.0 ), 5.0 + c);
303
287
}
304
288
305
- TEST_CASE (
306
- " Operations between real numbers and complex numbers -> Subtract real "
307
- " number from complex number" ,
289
+ TEST_CASE (" Operations between real numbers and complex numbers -> Subtract real number from complex number" ,
308
290
" [20432c8e-8960-4c40-ba83-c9d910ff0a0f]" ) {
309
291
const Complex c{5.0 , 7.0 };
310
292
311
293
require_approx_equal (Complex (1.0 , 7.0 ), c - 4.0 );
312
294
}
313
295
314
- TEST_CASE (
315
- " Operations between real numbers and complex numbers -> Subtract complex "
316
- " number from real number" ,
296
+ TEST_CASE (" Operations between real numbers and complex numbers -> Subtract complex number from real number" ,
317
297
" [b4b38c85-e1bf-437d-b04d-49bba6e55000]" ) {
318
298
const Complex c{5.0 , 7.0 };
319
299
320
300
require_approx_equal (Complex (-1.0 , -7.0 ), 4.0 - c);
321
301
}
322
302
323
- TEST_CASE (
324
- " Operations between real numbers and complex numbers -> Multiply complex "
325
- " number by real number" ,
303
+ TEST_CASE (" Operations between real numbers and complex numbers -> Multiply complex number by real number" ,
326
304
" [dabe1c8c-b8f4-44dd-879d-37d77c4d06bd]" ) {
327
305
const Complex c{2.0 , 5.0 };
328
306
329
307
require_approx_equal (Complex (10.0 , 25.0 ), c * 5.0 );
330
308
}
331
309
332
- TEST_CASE (
333
- " Operations between real numbers and complex numbers -> Multiply real "
334
- " number by complex number" ,
310
+ TEST_CASE (" Operations between real numbers and complex numbers -> Multiply real number by complex number" ,
335
311
" [6c81b8c8-9851-46f0-9de5-d96d314c3a28]" ) {
336
312
const Complex c{2.0 , 5.0 };
337
313
338
314
require_approx_equal (Complex (10.0 , 25.0 ), 5.0 * c);
339
315
}
340
316
341
- TEST_CASE (
342
- " Operations between real numbers and complex numbers -> Divide complex "
343
- " number by real number" ,
317
+ TEST_CASE (" Operations between real numbers and complex numbers -> Divide complex number by real number" ,
344
318
" [8a400f75-710e-4d0c-bcb4-5e5a00c78aa0]" ) {
345
319
const Complex c{10.0 , 100.0 };
346
320
347
321
require_approx_equal (Complex (1.0 , 10.0 ), c / 10.0 );
348
322
}
349
323
350
- TEST_CASE (
351
- " Operations between real numbers and complex numbers -> Divide real number "
352
- " by complex number" ,
324
+ TEST_CASE (" Operations between real numbers and complex numbers -> Divide real number by complex number" ,
353
325
" [9a867d1b-d736-4c41-a41e-90bd148e9d5e]" ) {
354
326
const Complex c{1.0 , 1.0 };
355
327
0 commit comments