Revision b55a9139 tests/check_geotransform.cpp

b/tests/check_geotransform.cpp
53 53
{
54 54
    Scene scene;
55 55
    SoundSource *node = scene.createSoundSource("bob");
56

  
56 57
    double x = 1.5;
57 58
    double y = 1.5;
58 59
    double z = 1.5;
60

  
59 61
    double pitch = 90.0;
60 62
    double roll = 0.0;
61 63
    double yaw = 0.0;
64

  
62 65
    double rotatedX = 1.5;
63 66
    double rotatedY = -1.5;
64 67
    double rotatedZ = 1.5;
......
71 74
    // we can't check for equality due to loss of precision, 
72 75
    // so we just make sure the calculated and expected values
73 76
    // are within a tolerance, EPSILON
74
    static const double EPSILON = 0.0001;
75
    if (fabs(node->getPosition().x - rotatedX) > EPSILON || 
76
        fabs(node->getPosition().y - rotatedY) > EPSILON || 
77
        fabs(node->getPosition().z - rotatedZ) > EPSILON)
77
    static const double EPSILON = 0.001;
78
    double delta_x = fabs(node->getPosition().x - rotatedX);
79
    double delta_y = fabs(node->getPosition().y - rotatedY);
80
    double delta_z = fabs(node->getPosition().z - rotatedZ);
81

  
82
    if (delta_x > EPSILON)
83
    {
84
        std::cout << __FUNCTION__ << ": delta_x = " << delta_x << std::endl;
85
        return false;
86
    }
87
    else if (delta_y > EPSILON)
88
    {
89
        std::cout << __FUNCTION__ << ": delta_y = " << delta_y << std::endl;
90
        return false;
91
    }
92
    else if (delta_z > EPSILON)
93
    {
94
        std::cout << __FUNCTION__ << ": delta_z = " << delta_z << std::endl;
78 95
        return false;
96
    }
79 97
    else
80 98
        return true;
81 99
}

Also available in: Unified diff