Sha256: a474f326b583fd958a1a90f33a0a73ca26c6cf092fb1392089949079a7261557

Contents?: true

Size: 1.62 KB

Versions: 6

Compression:

Stored size: 1.62 KB

Contents

<!DOCTYPE html>
<html>
<!--
Copyright 2011 The Closure Library Authors. All Rights Reserved.

Use of this source code is governed by the Apache License, Version 2.0.
See the COPYING file for details.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Closure Unit Tests - goog.vec.Float32Array</title>
<script src="../base.js"></script>
<script>
  goog.require('goog.vec.Float32Array');
  goog.require('goog.testing.jsunit');
</script>
</head>
<body>
<script>

  function testConstructorInitializesElementsToZero() {
    var f = new goog.vec.Float32Array(3);
    assertEquals(3, f.length);
    assertEquals(0, f[0]);
    assertEquals(0, f[1]);
    assertEquals(0, f[2]);
    assertEquals(4, f.BYTES_PER_ELEMENT);
    assertEquals(4, goog.vec.Float32Array.BYTES_PER_ELEMENT);
  }

  function testConstructorWithArrayAsArgument() {
    var f0 = new goog.vec.Float32Array([0, 0, 1, 0]);
    var f1 = new goog.vec.Float32Array(4);
    f1[0] = 0;
    f1[1] = 0;
    f1[2] = 1;
    f1[3] = 0;
    assertObjectEquals(f0, f1);
  }

  function testSet() {
    var f0 = new goog.vec.Float32Array(4);
    var f1 = new goog.vec.Float32Array(4);
    f0.set([1, 2, 3, 4]);
    f1[0] = 1;
    f1[1] = 2;
    f1[2] = 3;
    f1[3] = 4;
    assertObjectEquals(f0, f1);
  }

  function testSetWithOffset() {
    var f0 = new goog.vec.Float32Array(4);
    var f1 = new goog.vec.Float32Array(4);
    f0.set([5], 1);
    f1[0] = 0;
    f1[1] = 5;
    f1[2] = 0;
    f1[3] = 0;
    assertObjectEquals(f0, f1);
  }

  function testToString() {
    var f = new goog.vec.Float32Array([4, 3, 2, 1]);
    assertEquals('4,3,2,1', f.toString());
  }

</script>
</body>

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
k4compiler-0.0.1 third_party/closure-library/closure/goog/vec/float32array_test.html
middleman-wizard-template-1.0.4 lib/middleman-wizard-template/template/closure/library/closure/goog/vec/float32array_test.html
middleman-wizard-template-1.0.3 lib/middleman-wizard-template/template/closure/library/closure/goog/vec/float32array_test.html
middleman-wizard-template-1.0.2 lib/middleman-wizard-template/template/closure/library/closure/goog/vec/float32array_test.html
middleman-wizard-template-1.0.1 lib/middleman-wizard-template/template/closure/library/closure/goog/vec/float32array_test.html
middleman-wizard-template-1.0.0.pre.1 lib/middleman-wizard-template/template/closure/library/closure/goog/vec/float32array_test.html