Changeset 96216 in vbox for trunk/src/VBox/Runtime/testcase/tstRTNoCrt-2.cpp
- Timestamp:
- Aug 15, 2022 11:12:09 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstRTNoCrt-2.cpp
r96215 r96216 345 345 CHECK_LONG_SAME(llabs,(LONG_MIN)); 346 346 CHECK_LONG_SAME(llabs,(LONG_MAX)); 347 } 348 349 350 void testFAbs() 351 { 352 RTTestSub(g_hTest, "fabs[fl]"); 353 354 CHECK_DBL(RT_NOCRT(fabs)( +0.0), +0.0); 355 CHECK_DBL(RT_NOCRT(fabs)( -0.0), +0.0); 356 CHECK_DBL(RT_NOCRT(fabs)( -42.5), +42.5); 357 CHECK_DBL(RT_NOCRT(fabs)( +42.5), +42.5); 358 CHECK_DBL(RT_NOCRT(fabs)(+1234.60958634e+20), +1234.60958634e+20); 359 CHECK_DBL(RT_NOCRT(fabs)(-1234.60958634e+20), +1234.60958634e+20); 360 CHECK_DBL(RT_NOCRT(fabs)( +2.1984e-310), +2.1984e-310); /* subnormal */ 361 CHECK_DBL(RT_NOCRT(fabs)( -2.1984e-310), +2.1984e-310); /* subnormal */ 362 CHECK_DBL(RT_NOCRT(fabs)(-INFINITY), +INFINITY); 363 CHECK_DBL(RT_NOCRT(fabs)(+INFINITY), +INFINITY); 364 CHECK_DBL(RT_NOCRT(fabs)(RTStrNanDouble(NULL, true)), RTStrNanDouble(NULL, true)); 365 CHECK_DBL(RT_NOCRT(fabs)(RTStrNanDouble("s", false)), RTStrNanDouble("s", true)); 366 CHECK_DBL_SAME(fabs,( -0.0)); 367 CHECK_DBL_SAME(fabs,( +0.0)); 368 CHECK_DBL_SAME(fabs,( +22.5)); 369 CHECK_DBL_SAME(fabs,( -22.5)); 370 CHECK_DBL_SAME(fabs,( +2.1984e-310)); /* subnormal */ 371 CHECK_DBL_SAME(fabs,( -2.1984e-310)); /* subnormal */ 372 CHECK_DBL_SAME(fabs,(+1234.60958634e+20)); 373 CHECK_DBL_SAME(fabs,(-1234.60958634e+20)); 374 CHECK_DBL_SAME(fabs,(-INFINITY)); 375 CHECK_DBL_SAME(fabs,(+INFINITY)); 376 CHECK_DBL_SAME(fabs,(RTStrNanDouble(NULL, true))); 377 CHECK_DBL_SAME(fabs,(RTStrNanDouble("s", false))); 378 379 CHECK_FLT(RT_NOCRT(fabsf)( +0.0f), +0.0f); 380 CHECK_FLT(RT_NOCRT(fabsf)( -0.0f), +0.0f); 381 CHECK_FLT(RT_NOCRT(fabsf)( -42.5f), +42.5f); 382 CHECK_FLT(RT_NOCRT(fabsf)( +42.5f), +42.5f); 383 CHECK_FLT(RT_NOCRT(fabsf)(+1234.60958634e+20f), +1234.60958634e+20f); 384 CHECK_FLT(RT_NOCRT(fabsf)(-1234.60958634e+20f), +1234.60958634e+20f); 385 CHECK_FLT(RT_NOCRT(fabsf)( +2.1984e-310f), +2.1984e-310f); /* subnormal */ 386 CHECK_FLT(RT_NOCRT(fabsf)( -2.1984e-310f), +2.1984e-310f); /* subnormal */ 387 CHECK_FLT(RT_NOCRT(fabsf)(-INFINITY), +INFINITY); 388 CHECK_FLT(RT_NOCRT(fabsf)(+INFINITY), +INFINITY); 389 CHECK_FLT(RT_NOCRT(fabsf)(RTStrNanFloat(NULL, true)), RTStrNanFloat(NULL, true)); 390 CHECK_FLT(RT_NOCRT(fabsf)(RTStrNanFloat("s", false)), RTStrNanFloat("s", true)); 391 CHECK_FLT_SAME(fabsf,( -0.0f)); 392 CHECK_FLT_SAME(fabsf,( +0.0f)); 393 CHECK_FLT_SAME(fabsf,( +22.5f)); 394 CHECK_FLT_SAME(fabsf,( -22.5f)); 395 CHECK_FLT_SAME(fabsf,( +2.1984e-310f)); /* subnormal */ 396 CHECK_FLT_SAME(fabsf,( -2.1984e-310f)); /* subnormal */ 397 CHECK_FLT_SAME(fabsf,(+1234.60958634e+20f)); 398 CHECK_FLT_SAME(fabsf,(-1234.60958634e+20f)); 399 CHECK_FLT_SAME(fabsf,(-INFINITY)); 400 CHECK_FLT_SAME(fabsf,(+INFINITY)); 401 CHECK_FLT_SAME(fabsf,(RTStrNanFloat(NULL, true))); 402 #if 0 /* UCRT on windows converts this to a quiet NaN, so skip it. */ 403 CHECK_FLT_SAME(fabsf,(RTStrNanFloat("s", false))); 404 #endif 347 405 } 348 406 … … 2351 2409 2352 2410 /* math.h */ 2411 testFAbs(); 2353 2412 testCopySign(); 2354 2413 testFmax();
Note:
See TracChangeset
for help on using the changeset viewer.