Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Ignore real pad in core.internal.convert unittest
Browse files Browse the repository at this point in the history
Change unittest to ignore any pad bytes in a floating point type because
those bits are undefined. Fixes test part of ldc issue #788.
  • Loading branch information
smolt committed Jun 3, 2015
1 parent dc82475 commit fda62ef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/internal/convert.d
Expand Up @@ -325,7 +325,10 @@ version(unittest)

enum ctbytes = toUbyte2(ctval);

assert(rtbytes[] == ctbytes);
// don't test pad bytes because can be anything
enum testsize =
(FloatTraits!TYPE.EXPONENT + FloatTraits!TYPE.MANTISSA + 1)/8;
assert(rtbytes[0..testsize] == ctbytes[0..testsize]);
}

private void testConvert()
Expand Down

0 comments on commit fda62ef

Please sign in to comment.