Skip to content

Commit

Permalink
Fix model and pick tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Oct 2, 2018
1 parent 54ce914 commit 13e9f12
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
22 changes: 11 additions & 11 deletions Specs/Scene/ModelSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ defineSuite([
m.show = true;

expect(scene).toRenderAndCall(function(rgba) {
expect(rgba).toEqualEpsilon([169, 3, 3, 255], 5); // Red
expect(rgba).toEqualEpsilon([169, 3, 3, 255], 10); // Red
});

primitives.remove(m);
Expand Down Expand Up @@ -2292,22 +2292,22 @@ defineSuite([
// Red
scene.camera.moveLeft(0.5);
expect(scene).toRenderAndCall(function(rgba) {
expect(rgba[0]).toBeGreaterThan(10);
expect(rgba[1]).toBeLessThan(10);
expect(rgba[2]).toBeLessThan(10);
expect(rgba[0]).toBeGreaterThan(20);
expect(rgba[1]).toBeLessThan(20);
expect(rgba[2]).toBeLessThan(20);
});
// Green
scene.camera.moveRight(0.5);
expect(scene).toRenderAndCall(function(rgba) {
expect(rgba[0]).toBeLessThan(10);
expect(rgba[0]).toBeLessThan(20);
expect(rgba[1]).toBeGreaterThan(20);
expect(rgba[2]).toBeLessThan(10);
expect(rgba[2]).toBeLessThan(20);
});
// Blue
scene.camera.moveRight(0.5);
expect(scene).toRenderAndCall(function(rgba) {
expect(rgba[0]).toBeLessThan(10);
expect(rgba[1]).toBeLessThan(10);
expect(rgba[0]).toBeLessThan(20);
expect(rgba[1]).toBeLessThan(20);
expect(rgba[2]).toBeGreaterThan(20);
});
}
Expand Down Expand Up @@ -2347,9 +2347,9 @@ defineSuite([
model.zoomTo();
expect(scene).toRenderAndCall(function(rgba) {
// Emissive texture is red
expect(rgba[0]).toBeGreaterThan(10);
expect(rgba[1]).toBeLessThan(10);
expect(rgba[2]).toBeLessThan(10);
expect(rgba[0]).toBeGreaterThan(20);
expect(rgba[1]).toBeLessThan(20);
expect(rgba[2]).toBeLessThan(20);
});

primitives.remove(model);
Expand Down
7 changes: 5 additions & 2 deletions Specs/Scene/PickSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ defineSuite([
rectangle : Rectangle.fromDegrees(-50.0, -50.0, 50.0, 50.0),
granularity : CesiumMath.toRadians(20.0),
vertexFormat : EllipsoidSurfaceAppearance.VERTEX_FORMAT,
height : 1.0
height : 20.0
});

var instance1 = new GeometryInstance({
Expand Down Expand Up @@ -387,7 +387,7 @@ defineSuite([
rectangle : Rectangle.fromDegrees(-50.0, -50.0, 50.0, 50.0),
granularity : CesiumMath.toRadians(20.0),
vertexFormat : EllipsoidSurfaceAppearance.VERTEX_FORMAT,
height : 1.0
height : 20.0
});

var instance1 = new GeometryInstance({
Expand Down Expand Up @@ -467,6 +467,9 @@ defineSuite([
});

it('picks the globe', function() {
if (!scene.context.depthTexture) {
return;
}
return createGlobe().then(function() {
expect(scene).toPickFromRayAndCall(function(result) {
expect(result.object).toBeUndefined();
Expand Down

0 comments on commit 13e9f12

Please sign in to comment.