Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Workaround for a Windows Phone Emulator Code Conversion Bug

DZone's Guide to

Workaround for a Windows Phone Emulator Code Conversion Bug

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

The author of the Mister Goodcat blog believes he has found a bug in the Windows Phone emulator that is causing incorrect conversions of some of his old C++ code into C#:

If you use this code for example in a .NET 4 console application, the output is as expected:

True
Double: 1,51608955473738E+19
UInt64: 15160895547373793280

Now use the same code, but run it in a Windows Phone 7 application, for example in a button click event handler. The output is:

True
Double: 1.51608955473738E+19
UInt64: 9223372036854775808
Uhm… what?  -- Mister Goodcat

Luckily, he says this bug only occurs in the emulator and works fine when you go straight to the actual phone.  He also gives us a workaround in the blog post.  If you want to comment on the bug he believes he found in the Windows Phone emulator, he encourages people to contact him and take a look at his bug report here:

Windows Phone Emulator cast double/UInt64 bug

Source: http://www.pitorque.de/MisterGoodcat/post/Windows-Phone-7-The-kind-of-bug-you-dont-want-to-discover.aspx

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}