Index: test/mjsunit/bit-not.js |
=================================================================== |
--- test/mjsunit/bit-not.js (revision 3561) |
+++ test/mjsunit/bit-not.js (working copy) |
@@ -25,43 +25,43 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-function testBitNot(x) { |
+function testBitNot(x, name) { |
// The VM constant folds so we use that to check the result. |
var expected = eval("~(" + x + ")"); |
var actual = ~x; |
- assertEquals(expected, actual, "x: " + x); |
+ assertEquals(expected, actual, "x: " + name); |
// Test the path where we can overwrite the result. Use - |
// to avoid concatenating strings. |
expected = eval("~(" + x + " - 0.01)"); |
actual = ~(x - 0.01); |
- assertEquals(expected, actual, "x - 0.01: " + x); |
+ assertEquals(expected, actual, "x - 0.01: " + name); |
} |
-testBitNot(0); |
-testBitNot(1); |
-testBitNot(-1); |
-testBitNot(100); |
-testBitNot(0x40000000); |
-testBitNot(0x7fffffff); |
-testBitNot(0x80000000); |
+testBitNot(0, 0); |
+testBitNot(1, 1); |
+testBitNot(-1, 1); |
+testBitNot(100, 100); |
+testBitNot(0x40000000, "0x40000000"); |
+testBitNot(0x7fffffff, "0x7fffffff"); |
+testBitNot(0x80000000, "0x80000000"); |
-testBitNot(2.2); |
-testBitNot(-2.3); |
-testBitNot(Infinity); |
-testBitNot(NaN); |
-testBitNot(-Infinity); |
-testBitNot(0x40000000 + 0.12345); |
-testBitNot(0x40000000 - 0.12345); |
-testBitNot(0x7fffffff + 0.12345); |
-testBitNot(0x7fffffff - 0.12345); |
-testBitNot(0x80000000 + 0.12345); |
-testBitNot(0x80000000 - 0.12345); |
+testBitNot(2.2, 2.2); |
+testBitNot(-2.3, -2.3); |
+testBitNot(Infinity, "Infinity"); |
+testBitNot(NaN, "NaN"); |
+testBitNot(-Infinity, "-Infinity"); |
+testBitNot(0x40000000 + 0.12345, "float1"); |
+testBitNot(0x40000000 - 0.12345, "float2"); |
+testBitNot(0x7fffffff + 0.12345, "float3"); |
+testBitNot(0x7fffffff - 0.12345, "float4"); |
+testBitNot(0x80000000 + 0.12345, "float5"); |
+testBitNot(0x80000000 - 0.12345, "float6"); |
-testBitNot("0"); |
-testBitNot("2.3"); |
-testBitNot("-9.4"); |
+testBitNot("0", "string0"); |
+testBitNot("2.3", "string2.3"); |
+testBitNot("-9.4", "string-9.4"); |
// Try to test that we can deal with allocation failures in |