Browse Source

Tests: Make geometry tests more robust.

Mugen87 4 years ago
parent
commit
87554b9629

+ 3 - 2
test/unit/src/geometries/BoxGeometry.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 /* global QUnit */
 
 
 import { runStdGeometryTests } from '../../utils/qunit-utils';
 import { runStdGeometryTests } from '../../utils/qunit-utils';
-import { BoxGeometry } from '../../../../src/geometries/BoxGeometry';
+import { BoxGeometry, BoxBufferGeometry } from '../../../../src/geometries/BoxGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -22,7 +22,8 @@ export default QUnit.module( 'Geometries', () => {
 			geometries = [
 			geometries = [
 				new BoxGeometry(),
 				new BoxGeometry(),
 				new BoxGeometry( parameters.width, parameters.height, parameters.depth ),
 				new BoxGeometry( parameters.width, parameters.height, parameters.depth ),
-				new BoxGeometry( parameters.width, parameters.height, parameters.depth, parameters.widthSegments, parameters.heightSegments, parameters.depthSegments )
+				new BoxGeometry( parameters.width, parameters.height, parameters.depth, parameters.widthSegments, parameters.heightSegments, parameters.depthSegments ),
+				new BoxBufferGeometry()
 			];
 			];
 
 
 		} );
 		} );

+ 2 - 1
test/unit/src/geometries/CircleGeometry.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 /* global QUnit */
 
 
 import { runStdGeometryTests } from '../../utils/qunit-utils';
 import { runStdGeometryTests } from '../../utils/qunit-utils';
-import { CircleGeometry } from '../../../../src/geometries/CircleGeometry';
+import { CircleGeometry, CircleBufferGeometry } from '../../../../src/geometries/CircleGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -23,6 +23,7 @@ export default QUnit.module( 'Geometries', () => {
 				new CircleGeometry( parameters.radius, parameters.segments ),
 				new CircleGeometry( parameters.radius, parameters.segments ),
 				new CircleGeometry( parameters.radius, parameters.segments, parameters.thetaStart ),
 				new CircleGeometry( parameters.radius, parameters.segments, parameters.thetaStart ),
 				new CircleGeometry( parameters.radius, parameters.segments, parameters.thetaStart, parameters.thetaLength ),
 				new CircleGeometry( parameters.radius, parameters.segments, parameters.thetaStart, parameters.thetaLength ),
+					new CircleBufferGeometry(),
 			];
 			];
 
 
 		} );
 		} );

+ 3 - 2
test/unit/src/geometries/ConeGeometry.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 /* global QUnit */
 
 
 import { runStdGeometryTests } from '../../utils/qunit-utils';
 import { runStdGeometryTests } from '../../utils/qunit-utils';
-import { ConeGeometry } from '../../../../src/geometries/ConeGeometry';
+import { ConeGeometry, ConeBufferGeometry } from '../../../../src/geometries/ConeGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -11,7 +11,8 @@ export default QUnit.module( 'Geometries', () => {
 		hooks.beforeEach( function () {
 		hooks.beforeEach( function () {
 
 
 			geometries = [
 			geometries = [
-				new ConeGeometry()
+				new ConeGeometry(),
+				new ConeBufferGeometry()
 			];
 			];
 
 
 		} );
 		} );

+ 2 - 1
test/unit/src/geometries/CylinderGeometry.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 /* global QUnit */
 
 
 import { runStdGeometryTests } from '../../utils/qunit-utils';
 import { runStdGeometryTests } from '../../utils/qunit-utils';
-import { CylinderGeometry } from '../../../../src/geometries/CylinderGeometry';
+import { CylinderGeometry, CylinderBufferGeometry } from '../../../../src/geometries/CylinderGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -31,6 +31,7 @@ export default QUnit.module( 'Geometries', () => {
 				new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded ),
 				new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded ),
 				new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart ),
 				new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart ),
 				new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart, parameters.thetaLength ),
 				new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart, parameters.thetaLength ),
+				new CylinderBufferGeometry()
 			];
 			];
 
 
 		} );
 		} );

+ 2 - 1
test/unit/src/geometries/DodecahedronGeometry.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 /* global QUnit */
 
 
 import { runStdGeometryTests } from '../../utils/qunit-utils';
 import { runStdGeometryTests } from '../../utils/qunit-utils';
-import { DodecahedronGeometry } from '../../../../src/geometries/DodecahedronGeometry';
+import { DodecahedronGeometry, DodecahedronBufferGeometry } from '../../../../src/geometries/DodecahedronGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -19,6 +19,7 @@ export default QUnit.module( 'Geometries', () => {
 				new DodecahedronGeometry(),
 				new DodecahedronGeometry(),
 				new DodecahedronGeometry( parameters.radius ),
 				new DodecahedronGeometry( parameters.radius ),
 				new DodecahedronGeometry( parameters.radius, parameters.detail ),
 				new DodecahedronGeometry( parameters.radius, parameters.detail ),
+				new DodecahedronBufferGeometry()
 			];
 			];
 
 
 		} );
 		} );

+ 1 - 1
test/unit/src/geometries/ExtrudeGeometry.tests.js

@@ -1,6 +1,6 @@
 /* global QUnit */
 /* global QUnit */
 
 
-import { ExtrudeGeometry } from '../../../../src/geometries/ExtrudeGeometry';
+import { ExtrudeGeometry, ExtrudeBufferGeometry } from '../../../../src/geometries/ExtrudeGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 

+ 2 - 1
test/unit/src/geometries/IcosahedronGeometry.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 /* global QUnit */
 
 
 import { runStdGeometryTests } from '../../utils/qunit-utils';
 import { runStdGeometryTests } from '../../utils/qunit-utils';
-import { IcosahedronGeometry } from '../../../../src/geometries/IcosahedronGeometry';
+import { IcosahedronGeometry, IcosahedronBufferGeometry } from '../../../../src/geometries/IcosahedronGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -19,6 +19,7 @@ export default QUnit.module( 'Geometries', () => {
 				new IcosahedronGeometry(),
 				new IcosahedronGeometry(),
 				new IcosahedronGeometry( parameters.radius ),
 				new IcosahedronGeometry( parameters.radius ),
 				new IcosahedronGeometry( parameters.radius, parameters.detail ),
 				new IcosahedronGeometry( parameters.radius, parameters.detail ),
+				new IcosahedronBufferGeometry()
 			];
 			];
 
 
 		} );
 		} );

+ 3 - 2
test/unit/src/geometries/LatheGeometry.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 /* global QUnit */
 
 
 import { runStdGeometryTests } from '../../utils/qunit-utils';
 import { runStdGeometryTests } from '../../utils/qunit-utils';
-import { LatheGeometry } from '../../../../src/geometries/LatheGeometry';
+import { LatheGeometry, LatheBufferGeometry } from '../../../../src/geometries/LatheGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -18,7 +18,8 @@ export default QUnit.module( 'Geometries', () => {
 			};
 			};
 
 
 			geometries = [
 			geometries = [
-				new LatheGeometry( parameters.points )
+				new LatheGeometry( parameters.points ),
+				new LatheBufferGeometry( parameters.points ),
 			];
 			];
 
 
 		} );
 		} );

+ 2 - 1
test/unit/src/geometries/OctahedronGeometry.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 /* global QUnit */
 
 
 import { runStdGeometryTests } from '../../utils/qunit-utils';
 import { runStdGeometryTests } from '../../utils/qunit-utils';
-import { OctahedronGeometry } from '../../../../src/geometries/OctahedronGeometry';
+import { OctahedronGeometry, OctahedronBufferGeometry } from '../../../../src/geometries/OctahedronGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -19,6 +19,7 @@ export default QUnit.module( 'Geometries', () => {
 				new OctahedronGeometry(),
 				new OctahedronGeometry(),
 				new OctahedronGeometry( parameters.radius ),
 				new OctahedronGeometry( parameters.radius ),
 				new OctahedronGeometry( parameters.radius, parameters.detail ),
 				new OctahedronGeometry( parameters.radius, parameters.detail ),
+				new OctahedronBufferGeometry()
 			];
 			];
 
 
 		} );
 		} );

+ 3 - 2
test/unit/src/geometries/ParametricGeometry.tests.js

@@ -1,6 +1,6 @@
 /* global QUnit */
 /* global QUnit */
 
 
-import { ParametricGeometry } from '../../../../src/geometries/ParametricGeometry';
+import { ParametricGeometry, ParametricBufferGeometry } from '../../../../src/geometries/ParametricGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -10,7 +10,8 @@ export default QUnit.module( 'Geometries', () => {
 		hooks.beforeEach( function () {
 		hooks.beforeEach( function () {
 
 
 			geometries = [
 			geometries = [
-				new ParametricGeometry()
+				new ParametricGeometry(),
+				new ParametricBufferGeometry()
 			];
 			];
 
 
 		} );
 		} );

+ 2 - 1
test/unit/src/geometries/PlaneGeometry.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 /* global QUnit */
 
 
 import { runStdGeometryTests } from '../../utils/qunit-utils';
 import { runStdGeometryTests } from '../../utils/qunit-utils';
-import { PlaneGeometry } from '../../../../src/geometries/PlaneGeometry';
+import { PlaneGeometry, PlaneBufferGeometry } from '../../../../src/geometries/PlaneGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -23,6 +23,7 @@ export default QUnit.module( 'Geometries', () => {
 				new PlaneGeometry( parameters.width, parameters.height ),
 				new PlaneGeometry( parameters.width, parameters.height ),
 				new PlaneGeometry( parameters.width, parameters.height, parameters.widthSegments ),
 				new PlaneGeometry( parameters.width, parameters.height, parameters.widthSegments ),
 				new PlaneGeometry( parameters.width, parameters.height, parameters.widthSegments, parameters.heightSegments ),
 				new PlaneGeometry( parameters.width, parameters.height, parameters.widthSegments, parameters.heightSegments ),
+				new PlaneBufferGeometry()
 			];
 			];
 
 
 		} );
 		} );

+ 3 - 2
test/unit/src/geometries/PolyhedronGeometry.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 /* global QUnit */
 
 
 import { runStdGeometryTests } from '../../utils/qunit-utils';
 import { runStdGeometryTests } from '../../utils/qunit-utils';
-import { PolyhedronGeometry } from '../../../../src/geometries/PolyhedronGeometry';
+import { PolyhedronGeometry, PolyhedronBufferGeometry } from '../../../../src/geometries/PolyhedronGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -19,7 +19,8 @@ export default QUnit.module( 'Geometries', () => {
 			];
 			];
 
 
 			geometries = [
 			geometries = [
-				new PolyhedronGeometry( vertices, indices )
+				new PolyhedronGeometry( vertices, indices ),
+				new PolyhedronBufferGeometry( vertices, indices )
 			];
 			];
 
 
 		} );
 		} );

+ 2 - 1
test/unit/src/geometries/RingGeometry.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 /* global QUnit */
 
 
 import { runStdGeometryTests } from '../../utils/qunit-utils';
 import { runStdGeometryTests } from '../../utils/qunit-utils';
-import { RingGeometry } from '../../../../src/geometries/RingGeometry';
+import { RingGeometry, RingBufferGeometry } from '../../../../src/geometries/RingGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -27,6 +27,7 @@ export default QUnit.module( 'Geometries', () => {
 				new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments ),
 				new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments ),
 				new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart ),
 				new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart ),
 				new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart, parameters.thetaLength ),
 				new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart, parameters.thetaLength ),
+				new RingBufferGeometry()
 			];
 			];
 
 
 		} );
 		} );

+ 3 - 2
test/unit/src/geometries/ShapeGeometry.tests.js

@@ -1,6 +1,6 @@
 /* global QUnit */
 /* global QUnit */
 
 
-import { ShapeGeometry } from '../../../../src/geometries/ShapeGeometry';
+import { ShapeGeometry, ShapeBufferGeometry } from '../../../../src/geometries/ShapeGeometry';
 
 
 import { Shape } from '../../../../src/extras/core/Shape';
 import { Shape } from '../../../../src/extras/core/Shape';
 
 
@@ -17,7 +17,8 @@ export default QUnit.module( 'Geometries', () => {
 			triangleShape.lineTo( - 1, 1 );
 			triangleShape.lineTo( - 1, 1 );
 
 
 			geometries = [
 			geometries = [
-				new ShapeGeometry( triangleShape )
+				new ShapeGeometry( triangleShape ),
+				new ShapeBufferGeometry( triangleShape )
 			];
 			];
 
 
 		} );
 		} );

+ 2 - 1
test/unit/src/geometries/SphereGeometry.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 /* global QUnit */
 
 
 import { runStdGeometryTests } from '../../utils/qunit-utils';
 import { runStdGeometryTests } from '../../utils/qunit-utils';
-import { SphereGeometry } from '../../../../src/geometries/SphereGeometry';
+import { SphereGeometry, SphereBufferGeometry } from '../../../../src/geometries/SphereGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -29,6 +29,7 @@ export default QUnit.module( 'Geometries', () => {
 				new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength ),
 				new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength ),
 				new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart ),
 				new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart ),
 				new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart, parameters.thetaLength ),
 				new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart, parameters.thetaLength ),
+				new SphereBufferGeometry()
 			];
 			];
 
 
 		} );
 		} );

+ 3 - 2
test/unit/src/geometries/TetrahedronGeometry.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 /* global QUnit */
 
 
 import { runStdGeometryTests } from '../../utils/qunit-utils';
 import { runStdGeometryTests } from '../../utils/qunit-utils';
-import { TetrahedronGeometry } from '../../../../src/geometries/TetrahedronGeometry';
+import { TetrahedronGeometry, TetrahedronBufferGeometry } from '../../../../src/geometries/TetrahedronGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -18,7 +18,8 @@ export default QUnit.module( 'Geometries', () => {
 			geometries = [
 			geometries = [
 				new TetrahedronGeometry(),
 				new TetrahedronGeometry(),
 				new TetrahedronGeometry( parameters.radius ),
 				new TetrahedronGeometry( parameters.radius ),
-				new TetrahedronGeometry( parameters.radius, parameters.detail )
+				new TetrahedronGeometry( parameters.radius, parameters.detail ),
+				new TetrahedronBufferGeometry()
 			];
 			];
 
 
 		} );
 		} );

+ 1 - 1
test/unit/src/geometries/TextGeometry.tests.js

@@ -1,6 +1,6 @@
 /* global QUnit */
 /* global QUnit */
 
 
-import { TextGeometry } from '../../../../src/geometries/TextGeometry';
+import { TextGeometry, TextBufferGeometry } from '../../../../src/geometries/TextGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 

+ 2 - 1
test/unit/src/geometries/TorusGeometry.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 /* global QUnit */
 
 
 import { runStdGeometryTests } from '../../utils/qunit-utils';
 import { runStdGeometryTests } from '../../utils/qunit-utils';
-import { TorusGeometry } from '../../../../src/geometries/TorusGeometry';
+import { TorusGeometry, TorusBufferGeometry } from '../../../../src/geometries/TorusGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -25,6 +25,7 @@ export default QUnit.module( 'Geometries', () => {
 				new TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments ),
 				new TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments ),
 				new TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments ),
 				new TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments ),
 				new TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments, parameters.arc ),
 				new TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments, parameters.arc ),
+				new TorusBufferGeometry()
 			];
 			];
 
 
 		} );
 		} );

+ 2 - 1
test/unit/src/geometries/TorusKnotGeometry.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 /* global QUnit */
 
 
 import { runStdGeometryTests } from '../../utils/qunit-utils';
 import { runStdGeometryTests } from '../../utils/qunit-utils';
-import { TorusKnotGeometry } from '../../../../src/geometries/TorusKnotGeometry';
+import { TorusKnotGeometry, TorusKnotBufferGeometry } from '../../../../src/geometries/TorusKnotGeometry';
 
 
 export default QUnit.module( 'Geometries', () => {
 export default QUnit.module( 'Geometries', () => {
 
 
@@ -26,6 +26,7 @@ export default QUnit.module( 'Geometries', () => {
 				new TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments ),
 				new TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments ),
 				new TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments ),
 				new TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments ),
 				new TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments, parameters.p, parameters.q ),
 				new TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments, parameters.p, parameters.q ),
+				new TorusKnotBufferGeometry()
 			];
 			];
 
 
 		} );
 		} );

+ 3 - 2
test/unit/src/geometries/TubeGeometry.tests.js

@@ -1,6 +1,6 @@
 /* global QUnit */
 /* global QUnit */
 
 
-import { TubeGeometry } from '../../../../src/geometries/TubeGeometry';
+import { TubeGeometry, TubeBufferGeometry } from '../../../../src/geometries/TubeGeometry';
 
 
 import { LineCurve3 } from '../../../../src/extras/curves/LineCurve3';
 import { LineCurve3 } from '../../../../src/extras/curves/LineCurve3';
 import { Vector3 } from '../../../../src/math/Vector3';
 import { Vector3 } from '../../../../src/math/Vector3';
@@ -15,7 +15,8 @@ export default QUnit.module( 'Geometries', () => {
 			var path = new LineCurve3( new Vector3( 0, 0, 0 ), new Vector3( 0, 1, 0 ) );
 			var path = new LineCurve3( new Vector3( 0, 0, 0 ), new Vector3( 0, 1, 0 ) );
 
 
 			geometries = [
 			geometries = [
-				new TubeGeometry( path )
+				new TubeGeometry( path ),
+				new TubeBufferGeometry( path )
 			];
 			];
 
 
 		} );
 		} );