1 /* 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 12 /* 13 * This file contains the SPL unit_test. 14 * 15 */ 16 17 #include "unit_test.h" 18 #include "signal_processing_library.h" 19 20 class SplEnvironment : public ::testing::Environment { 21 public: 22 virtual void SetUp() { 23 } 24 virtual void TearDown() { 25 } 26 }; 27 28 SplTest::SplTest() 29 { 30 } 31 32 void SplTest::SetUp() { 33 } 34 35 void SplTest::TearDown() { 36 } 37 38 TEST_F(SplTest, MacroTest) { 39 // Macros with inputs. 40 int A = 10; 41 int B = 21; 42 int a = -3; 43 int b = WEBRTC_SPL_WORD32_MAX; 44 int nr = 2; 45 int d_ptr1 = 0; 46 int d_ptr2 = 0; 47 48 EXPECT_EQ(10, WEBRTC_SPL_MIN(A, B)); 49 EXPECT_EQ(21, WEBRTC_SPL_MAX(A, B)); 50 51 EXPECT_EQ(3, WEBRTC_SPL_ABS_W16(a)); 52 EXPECT_EQ(3, WEBRTC_SPL_ABS_W32(a)); 53 EXPECT_EQ(0, WEBRTC_SPL_GET_BYTE(&B, nr)); 54 WEBRTC_SPL_SET_BYTE(&d_ptr2, 1, nr); 55 EXPECT_EQ(65536, d_ptr2); 56 57 EXPECT_EQ(-63, WEBRTC_SPL_MUL(a, B)); 58 EXPECT_EQ(-2147483645, WEBRTC_SPL_MUL(a, b)); 59 EXPECT_EQ(-2147483645, WEBRTC_SPL_UMUL(a, b)); 60 b = WEBRTC_SPL_WORD16_MAX >> 1; 61 EXPECT_EQ(65535, WEBRTC_SPL_UMUL_RSFT16(a, b)); 62 EXPECT_EQ(1073627139, WEBRTC_SPL_UMUL_16_16(a, b)); 63 EXPECT_EQ(16382, WEBRTC_SPL_UMUL_16_16_RSFT16(a, b)); 64 EXPECT_EQ(-49149, WEBRTC_SPL_UMUL_32_16(a, b)); 65 EXPECT_EQ(65535, WEBRTC_SPL_UMUL_32_16_RSFT16(a, b)); 66 EXPECT_EQ(-49149, WEBRTC_SPL_MUL_16_U16(a, b)); 67 68 a = b; 69 b = -3; 70 EXPECT_EQ(-5461, WEBRTC_SPL_DIV(a, b)); 71 EXPECT_EQ(0, WEBRTC_SPL_UDIV(a, b)); 72 73 EXPECT_EQ(-1, WEBRTC_SPL_MUL_16_32_RSFT16(a, b)); 74 EXPECT_EQ(-1, WEBRTC_SPL_MUL_16_32_RSFT15(a, b)); 75 EXPECT_EQ(-3, WEBRTC_SPL_MUL_16_32_RSFT14(a, b)); 76 EXPECT_EQ(-24, WEBRTC_SPL_MUL_16_32_RSFT11(a, b)); 77 78 int a32 = WEBRTC_SPL_WORD32_MAX; 79 int a32a = (WEBRTC_SPL_WORD32_MAX >> 16); 80 int a32b = (WEBRTC_SPL_WORD32_MAX & 0x0000ffff); 81 EXPECT_EQ(5, WEBRTC_SPL_MUL_32_32_RSFT32(a32a, a32b, A)); 82 EXPECT_EQ(5, WEBRTC_SPL_MUL_32_32_RSFT32BI(a32, A)); 83 84 EXPECT_EQ(-49149, WEBRTC_SPL_MUL_16_16(a, b)); 85 EXPECT_EQ(-12288, WEBRTC_SPL_MUL_16_16_RSFT(a, b, 2)); 86 87 EXPECT_EQ(-12287, WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(a, b, 2)); 88 EXPECT_EQ(-1, WEBRTC_SPL_MUL_16_16_RSFT_WITH_FIXROUND(a, b)); 89 90 EXPECT_EQ(16380, WEBRTC_SPL_ADD_SAT_W32(a, b)); 91 EXPECT_EQ(21, WEBRTC_SPL_SAT(a, A, B)); 92 EXPECT_EQ(21, WEBRTC_SPL_SAT(a, B, A)); 93 EXPECT_EQ(-49149, WEBRTC_SPL_MUL_32_16(a, b)); 94 95 EXPECT_EQ(16386, WEBRTC_SPL_SUB_SAT_W32(a, b)); 96 EXPECT_EQ(16380, WEBRTC_SPL_ADD_SAT_W16(a, b)); 97 EXPECT_EQ(16386, WEBRTC_SPL_SUB_SAT_W16(a, b)); 98 99 EXPECT_TRUE(WEBRTC_SPL_IS_NEG(b)); 100 101 // Shifting with negative numbers allowed 102 // Positive means left shift 103 EXPECT_EQ(32766, WEBRTC_SPL_SHIFT_W16(a, 1)); 104 EXPECT_EQ(32766, WEBRTC_SPL_SHIFT_W32(a, 1)); 105 106 // Shifting with negative numbers not allowed 107 // We cannot do casting here due to signed/unsigned problem 108 EXPECT_EQ(8191, WEBRTC_SPL_RSHIFT_W16(a, 1)); 109 EXPECT_EQ(32766, WEBRTC_SPL_LSHIFT_W16(a, 1)); 110 EXPECT_EQ(8191, WEBRTC_SPL_RSHIFT_W32(a, 1)); 111 EXPECT_EQ(32766, WEBRTC_SPL_LSHIFT_W32(a, 1)); 112 113 EXPECT_EQ(8191, WEBRTC_SPL_RSHIFT_U16(a, 1)); 114 EXPECT_EQ(32766, WEBRTC_SPL_LSHIFT_U16(a, 1)); 115 EXPECT_EQ(8191, WEBRTC_SPL_RSHIFT_U32(a, 1)); 116 EXPECT_EQ(32766, WEBRTC_SPL_LSHIFT_U32(a, 1)); 117 118 EXPECT_EQ(1470, WEBRTC_SPL_RAND(A)); 119 } 120 121 TEST_F(SplTest, InlineTest) { 122 123 WebRtc_Word16 a = 121; 124 WebRtc_Word16 b = -17; 125 WebRtc_Word32 A = 111121; 126 WebRtc_Word32 B = -1711; 127 char* bVersion = (char*) malloc(8); 128 129 EXPECT_EQ(104, WebRtcSpl_AddSatW16(a, b)); 130 EXPECT_EQ(138, WebRtcSpl_SubSatW16(a, b)); 131 132 EXPECT_EQ(109410, WebRtcSpl_AddSatW32(A, B)); 133 EXPECT_EQ(112832, WebRtcSpl_SubSatW32(A, B)); 134 135 EXPECT_EQ(17, WebRtcSpl_GetSizeInBits(A)); 136 EXPECT_EQ(14, WebRtcSpl_NormW32(A)); 137 EXPECT_EQ(4, WebRtcSpl_NormW16(B)); 138 EXPECT_EQ(15, WebRtcSpl_NormU32(A)); 139 140 EXPECT_EQ(0, WebRtcSpl_get_version(bVersion, 8)); 141 } 142 143 TEST_F(SplTest, MathOperationsTest) { 144 145 int A = 117; 146 WebRtc_Word32 num = 117; 147 WebRtc_Word32 den = -5; 148 WebRtc_UWord16 denU = 5; 149 EXPECT_EQ(10, WebRtcSpl_Sqrt(A)); 150 EXPECT_EQ(10, WebRtcSpl_SqrtFloor(A)); 151 152 153 EXPECT_EQ(-91772805, WebRtcSpl_DivResultInQ31(den, num)); 154 EXPECT_EQ(-23, WebRtcSpl_DivW32W16ResW16(num, (WebRtc_Word16)den)); 155 EXPECT_EQ(-23, WebRtcSpl_DivW32W16(num, (WebRtc_Word16)den)); 156 EXPECT_EQ(23, WebRtcSpl_DivU32U16(num, denU)); 157 EXPECT_EQ(0, WebRtcSpl_DivW32HiLow(128, 0, 256)); 158 } 159 160 TEST_F(SplTest, BasicArrayOperationsTest) { 161 162 163 int B[] = {4, 12, 133, 1100}; 164 int Bs[] = {2, 6, 66, 550}; 165 WebRtc_UWord8* b8 = (WebRtc_UWord8*) malloc(4); 166 WebRtc_Word16* b16 = (WebRtc_Word16*) malloc(4); 167 WebRtc_Word32* b32 = (WebRtc_Word32*) malloc(4); 168 169 WebRtc_UWord8* bTmp8 = (WebRtc_UWord8*) malloc(4); 170 WebRtc_Word16* bTmp16 = (WebRtc_Word16*) malloc(4); 171 WebRtc_Word32* bTmp32 = (WebRtc_Word32*) malloc(4); 172 173 WebRtcSpl_MemSetW16(b16, 3, 4); 174 for (int kk = 0; kk < 4; ++kk) { 175 EXPECT_EQ(3, b16[kk]); 176 } 177 EXPECT_EQ(4, WebRtcSpl_ZerosArrayW16(b16, 4)); 178 for (int kk = 0; kk < 4; ++kk) { 179 EXPECT_EQ(0, b16[kk]); 180 } 181 EXPECT_EQ(4, WebRtcSpl_OnesArrayW16(b16, 4)); 182 for (int kk = 0; kk < 4; ++kk) { 183 EXPECT_EQ(1, b16[kk]); 184 } 185 WebRtcSpl_MemSetW32(b32, 3, 4); 186 for (int kk = 0; kk < 4; ++kk) { 187 EXPECT_EQ(3, b32[kk]); 188 } 189 EXPECT_EQ(4, WebRtcSpl_ZerosArrayW32(b32, 4)); 190 for (int kk = 0; kk < 4; ++kk) { 191 EXPECT_EQ(0, b32[kk]); 192 } 193 EXPECT_EQ(4, WebRtcSpl_OnesArrayW32(b32, 4)); 194 for (int kk = 0; kk < 4; ++kk) { 195 EXPECT_EQ(1, b32[kk]); 196 } 197 for (int kk = 0; kk < 4; ++kk) { 198 bTmp8[kk] = (WebRtc_Word8)kk; 199 bTmp16[kk] = (WebRtc_Word16)kk; 200 bTmp32[kk] = (WebRtc_Word32)kk; 201 } 202 WEBRTC_SPL_MEMCPY_W8(b8, bTmp8, 4); 203 for (int kk = 0; kk < 4; ++kk) { 204 EXPECT_EQ(b8[kk], bTmp8[kk]); 205 } 206 WEBRTC_SPL_MEMCPY_W16(b16, bTmp16, 4); 207 for (int kk = 0; kk < 4; ++kk) { 208 EXPECT_EQ(b16[kk], bTmp16[kk]); 209 } 210 // WEBRTC_SPL_MEMCPY_W32(b32, bTmp32, 4); 211 // for (int kk = 0; kk < 4; ++kk) { 212 // EXPECT_EQ(b32[kk], bTmp32[kk]); 213 // } 214 EXPECT_EQ(2, WebRtcSpl_CopyFromEndW16(b16, 4, 2, bTmp16)); 215 for (int kk = 0; kk < 2; ++kk) { 216 EXPECT_EQ(kk+2, bTmp16[kk]); 217 } 218 219 for (int kk = 0; kk < 4; ++kk) { 220 b32[kk] = B[kk]; 221 b16[kk] = (WebRtc_Word16)B[kk]; 222 } 223 WebRtcSpl_VectorBitShiftW32ToW16(bTmp16, 4, b32, 1); 224 for (int kk = 0; kk < 4; ++kk) { 225 EXPECT_EQ((B[kk]>>1), bTmp16[kk]); 226 } 227 WebRtcSpl_VectorBitShiftW16(bTmp16, 4, b16, 1); 228 for (int kk = 0; kk < 4; ++kk) { 229 EXPECT_EQ((B[kk]>>1), bTmp16[kk]); 230 } 231 WebRtcSpl_VectorBitShiftW32(bTmp32, 4, b32, 1); 232 for (int kk = 0; kk < 4; ++kk) { 233 EXPECT_EQ((B[kk]>>1), bTmp32[kk]); 234 } 235 236 WebRtcSpl_MemCpyReversedOrder(&bTmp16[3], b16, 4); 237 for (int kk = 0; kk < 4; ++kk) { 238 EXPECT_EQ(b16[3-kk], bTmp16[kk]); 239 } 240 241 } 242 243 TEST_F(SplTest, MinMaxOperationsTest) { 244 245 246 int B[] = {4, 12, 133, -1100}; 247 WebRtc_Word16* b16 = (WebRtc_Word16*) malloc(4); 248 WebRtc_Word32* b32 = (WebRtc_Word32*) malloc(4); 249 250 for (int kk = 0; kk < 4; ++kk) { 251 b16[kk] = B[kk]; 252 b32[kk] = B[kk]; 253 } 254 255 EXPECT_EQ(1100, WebRtcSpl_MaxAbsValueW16(b16, 4)); 256 EXPECT_EQ(1100, WebRtcSpl_MaxAbsValueW32(b32, 4)); 257 EXPECT_EQ(133, WebRtcSpl_MaxValueW16(b16, 4)); 258 EXPECT_EQ(133, WebRtcSpl_MaxValueW32(b32, 4)); 259 EXPECT_EQ(3, WebRtcSpl_MaxAbsIndexW16(b16, 4)); 260 EXPECT_EQ(2, WebRtcSpl_MaxIndexW16(b16, 4)); 261 EXPECT_EQ(2, WebRtcSpl_MaxIndexW32(b32, 4)); 262 263 EXPECT_EQ(-1100, WebRtcSpl_MinValueW16(b16, 4)); 264 EXPECT_EQ(-1100, WebRtcSpl_MinValueW32(b32, 4)); 265 EXPECT_EQ(3, WebRtcSpl_MinIndexW16(b16, 4)); 266 EXPECT_EQ(3, WebRtcSpl_MinIndexW32(b32, 4)); 267 268 EXPECT_EQ(0, WebRtcSpl_GetScalingSquare(b16, 4, 1)); 269 270 } 271 272 TEST_F(SplTest, VectorOperationsTest) { 273 274 275 int B[] = {4, 12, 133, 1100}; 276 WebRtc_Word16* a16 = (WebRtc_Word16*) malloc(4); 277 WebRtc_Word16* b16 = (WebRtc_Word16*) malloc(4); 278 WebRtc_Word32* b32 = (WebRtc_Word32*) malloc(4); 279 WebRtc_Word16* bTmp16 = (WebRtc_Word16*) malloc(4); 280 281 for (int kk = 0; kk < 4; ++kk) { 282 a16[kk] = B[kk]; 283 b16[kk] = B[kk]; 284 } 285 286 WebRtcSpl_AffineTransformVector(bTmp16, b16, 3, 7, 2, 4); 287 for (int kk = 0; kk < 4; ++kk) { 288 EXPECT_EQ((B[kk]*3+7)>>2, bTmp16[kk]); 289 } 290 WebRtcSpl_ScaleAndAddVectorsWithRound(b16, 3, b16, 2, 2, bTmp16, 4); 291 for (int kk = 0; kk < 4; ++kk) { 292 EXPECT_EQ((B[kk]*3+B[kk]*2+2)>>2, bTmp16[kk]); 293 } 294 295 WebRtcSpl_AddAffineVectorToVector(bTmp16, b16, 3, 7, 2, 4); 296 for (int kk = 0; kk < 4; ++kk) { 297 EXPECT_EQ(((B[kk]*3+B[kk]*2+2)>>2)+((b16[kk]*3+7)>>2), bTmp16[kk]); 298 } 299 300 WebRtcSpl_CrossCorrelation(b32, b16, bTmp16, 4, 2, 2, 0); 301 for (int kk = 0; kk < 2; ++kk) { 302 EXPECT_EQ(614236, b32[kk]); 303 } 304 // EXPECT_EQ(, WebRtcSpl_DotProduct(b16, bTmp16, 4)); 305 EXPECT_EQ(306962, WebRtcSpl_DotProductWithScale(b16, b16, 4, 2)); 306 307 WebRtcSpl_ScaleVector(b16, bTmp16, 13, 4, 2); 308 for (int kk = 0; kk < 4; ++kk) { 309 EXPECT_EQ((b16[kk]*13)>>2, bTmp16[kk]); 310 } 311 WebRtcSpl_ScaleVectorWithSat(b16, bTmp16, 13, 4, 2); 312 for (int kk = 0; kk < 4; ++kk) { 313 EXPECT_EQ((b16[kk]*13)>>2, bTmp16[kk]); 314 } 315 WebRtcSpl_ScaleAndAddVectors(a16, 13, 2, b16, 7, 2, bTmp16, 4); 316 for (int kk = 0; kk < 4; ++kk) { 317 EXPECT_EQ(((a16[kk]*13)>>2)+((b16[kk]*7)>>2), bTmp16[kk]); 318 } 319 320 WebRtcSpl_AddVectorsAndShift(bTmp16, a16, b16, 4, 2); 321 for (int kk = 0; kk < 4; ++kk) { 322 EXPECT_EQ(B[kk] >> 1, bTmp16[kk]); 323 } 324 WebRtcSpl_ReverseOrderMultArrayElements(bTmp16, a16, &b16[3], 4, 2); 325 for (int kk = 0; kk < 4; ++kk) { 326 EXPECT_EQ((a16[kk]*b16[3-kk])>>2, bTmp16[kk]); 327 } 328 WebRtcSpl_ElementwiseVectorMult(bTmp16, a16, b16, 4, 6); 329 for (int kk = 0; kk < 4; ++kk) { 330 EXPECT_EQ((a16[kk]*b16[kk])>>6, bTmp16[kk]); 331 } 332 333 WebRtcSpl_SqrtOfOneMinusXSquared(b16, 4, bTmp16); 334 for (int kk = 0; kk < 3; ++kk) { 335 EXPECT_EQ(32767, bTmp16[kk]); 336 } 337 EXPECT_EQ(32749, bTmp16[3]); 338 } 339 340 TEST_F(SplTest, EstimatorsTest) { 341 342 343 int B[] = {4, 12, 133, 1100}; 344 WebRtc_Word16* b16 = (WebRtc_Word16*) malloc(4); 345 WebRtc_Word32* b32 = (WebRtc_Word32*) malloc(4); 346 WebRtc_Word16* bTmp16 = (WebRtc_Word16*) malloc(4); 347 348 for (int kk = 0; kk < 4; ++kk) { 349 b16[kk] = B[kk]; 350 b32[kk] = B[kk]; 351 } 352 353 EXPECT_EQ(0, WebRtcSpl_LevinsonDurbin(b32, b16, bTmp16, 2)); 354 355 } 356 357 TEST_F(SplTest, FilterTest) { 358 359 360 WebRtc_Word16 A[] = {1, 2, 33, 100}; 361 WebRtc_Word16 A5[] = {1, 2, 33, 100, -5}; 362 WebRtc_Word16 B[] = {4, 12, 133, 110}; 363 WebRtc_Word16* b16 = (WebRtc_Word16*) malloc(4); 364 WebRtc_Word16* bTmp16 = (WebRtc_Word16*) malloc(4); 365 WebRtc_Word16* bTmp16Low = (WebRtc_Word16*) malloc(4); 366 WebRtc_Word16* bState = (WebRtc_Word16*) malloc(4); 367 WebRtc_Word16* bStateLow = (WebRtc_Word16*) malloc(4); 368 369 WebRtcSpl_ZerosArrayW16(bState, 4); 370 WebRtcSpl_ZerosArrayW16(bStateLow, 4); 371 372 for (int kk = 0; kk < 4; ++kk) { 373 b16[kk] = A[kk]; 374 } 375 376 // MA filters 377 WebRtcSpl_FilterMAFastQ12(b16, bTmp16, B, 4, 4); 378 for (int kk = 0; kk < 4; ++kk) { 379 //EXPECT_EQ(aTmp16[kk], bTmp16[kk]); 380 } 381 // AR filters 382 WebRtcSpl_FilterARFastQ12(b16, bTmp16, A, 4, 4); 383 for (int kk = 0; kk < 4; ++kk) { 384 // EXPECT_EQ(aTmp16[kk], bTmp16[kk]); 385 } 386 EXPECT_EQ(4, WebRtcSpl_FilterAR(A5, 5, b16, 4, bState, 4, bStateLow, 4, bTmp16, bTmp16Low, 4)); 387 388 } 389 390 TEST_F(SplTest, RandTest) { 391 392 393 WebRtc_Word16 BU[] = {3653, 12446, 8525, 30691}; 394 WebRtc_Word16 BN[] = {3459, -11689, -258, -3738}; 395 WebRtc_Word16* b16 = (WebRtc_Word16*) malloc(4); 396 WebRtc_UWord32* bSeed = (WebRtc_UWord32*) malloc(1); 397 398 bSeed[0] = 100000; 399 400 EXPECT_EQ(464449057, WebRtcSpl_IncreaseSeed(bSeed)); 401 EXPECT_EQ(31565, WebRtcSpl_RandU(bSeed)); 402 EXPECT_EQ(-9786, WebRtcSpl_RandN(bSeed)); 403 EXPECT_EQ(4, WebRtcSpl_RandUArray(b16, 4, bSeed)); 404 for (int kk = 0; kk < 4; ++kk) { 405 EXPECT_EQ(BU[kk], b16[kk]); 406 } 407 } 408 409 TEST_F(SplTest, SignalProcessingTest) { 410 411 412 int A[] = {1, 2, 33, 100}; 413 WebRtc_Word16* b16 = (WebRtc_Word16*) malloc(4); 414 WebRtc_Word32* b32 = (WebRtc_Word32*) malloc(4); 415 416 WebRtc_Word16* bTmp16 = (WebRtc_Word16*) malloc(4); 417 WebRtc_Word32* bTmp32 = (WebRtc_Word32*) malloc(4); 418 419 int bScale = 0; 420 421 for (int kk = 0; kk < 4; ++kk) { 422 b16[kk] = A[kk]; 423 b32[kk] = A[kk]; 424 } 425 426 EXPECT_EQ(2, WebRtcSpl_AutoCorrelation(b16, 4, 1, bTmp32, &bScale)); 427 WebRtcSpl_ReflCoefToLpc(b16, 4, bTmp16); 428 // for (int kk = 0; kk < 4; ++kk) { 429 // EXPECT_EQ(aTmp16[kk], bTmp16[kk]); 430 // } 431 WebRtcSpl_LpcToReflCoef(bTmp16, 4, b16); 432 // for (int kk = 0; kk < 4; ++kk) { 433 // EXPECT_EQ(a16[kk], b16[kk]); 434 // } 435 WebRtcSpl_AutoCorrToReflCoef(b32, 4, bTmp16); 436 // for (int kk = 0; kk < 4; ++kk) { 437 // EXPECT_EQ(aTmp16[kk], bTmp16[kk]); 438 // } 439 WebRtcSpl_GetHanningWindow(bTmp16, 4); 440 // for (int kk = 0; kk < 4; ++kk) { 441 // EXPECT_EQ(aTmp16[kk], bTmp16[kk]); 442 // } 443 444 for (int kk = 0; kk < 4; ++kk) { 445 b16[kk] = A[kk]; 446 } 447 EXPECT_EQ(11094 , WebRtcSpl_Energy(b16, 4, &bScale)); 448 EXPECT_EQ(0, bScale); 449 } 450 451 TEST_F(SplTest, FFTTest) { 452 453 454 WebRtc_Word16 B[] = {1, 2, 33, 100, 455 2, 3, 34, 101, 456 3, 4, 35, 102, 457 4, 5, 36, 103}; 458 459 EXPECT_EQ(0, WebRtcSpl_ComplexFFT(B, 3, 1)); 460 // for (int kk = 0; kk < 16; ++kk) { 461 // EXPECT_EQ(A[kk], B[kk]); 462 // } 463 EXPECT_EQ(0, WebRtcSpl_ComplexIFFT(B, 3, 1)); 464 // for (int kk = 0; kk < 16; ++kk) { 465 // EXPECT_EQ(A[kk], B[kk]); 466 // } 467 WebRtcSpl_ComplexBitReverse(B, 3); 468 for (int kk = 0; kk < 16; ++kk) { 469 //EXPECT_EQ(A[kk], B[kk]); 470 } 471 } 472 473 int main(int argc, char** argv) { 474 ::testing::InitGoogleTest(&argc, argv); 475 SplEnvironment* env = new SplEnvironment; 476 ::testing::AddGlobalTestEnvironment(env); 477 478 return RUN_ALL_TESTS(); 479 } 480