summaryrefslogtreecommitdiffstats
path: root/test/codec_arraybuffer_test.js
diff options
context:
space:
mode:
authorMarco Munizaga <marco.munizaga@ufl.edu>2013-10-26 19:19:42 -0400
committerMarco Munizaga <marco.munizaga@ufl.edu>2013-10-26 19:19:57 -0400
commit3946df7f72caac0859f34e40be7037efaa9feae8 (patch)
treeda81b4f09396610eecc45001bfe444387fb53c4a /test/codec_arraybuffer_test.js
parent0e6166ee4418bec330fcbc356be1a8225865b02d (diff)
downloadsjcl-3946df7f72caac0859f34e40be7037efaa9feae8.zip
sjcl-3946df7f72caac0859f34e40be7037efaa9feae8.tar.gz
sjcl-3946df7f72caac0859f34e40be7037efaa9feae8.tar.bz2
updated tests
Diffstat (limited to 'test/codec_arraybuffer_test.js')
-rw-r--r--test/codec_arraybuffer_test.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/codec_arraybuffer_test.js b/test/codec_arraybuffer_test.js
index 6dba0ad..f2d0950 100644
--- a/test/codec_arraybuffer_test.js
+++ b/test/codec_arraybuffer_test.js
@@ -1,6 +1,9 @@
//Run using phantomjs, since rhino doesn't support array buffers, and node has an issue with create dataviews with a bytelength of 0
sjcl = require("../sjcl.js")
+console.log("Running ArrayBuffer Codec tests")
+var start_time = +(new Date())
+
//This ccm implementation is only defined for IV Lengths of 8 bytes
var test_bytes = []
@@ -12,6 +15,7 @@ var zeropad_hex = function(number){
return hex
}
+
for (var i = 0; i <= 0xffff; i++){
test_bytes.push(zeropad_hex(i))
}
@@ -25,9 +29,13 @@ test_bytes.map(function(test_byte, index){
if (roundTripHex !== test_byte){
console.error("Failed test, expected ",roundTripHex,"to be",test_byte)
- throw("Failed at: "+i)
+ console.error("Failed at: "+i)
+ phantom.exit(1)
}
})
+var total_time = parseInt(+(new Date())-start_time)
+console.log(" + passed all",test_bytes.length,"tests. ("+ total_time, "ms)")
+
phantom.exit()