1 /* Copyright 2002-2022 CS GROUP
2 * Licensed to CS GROUP (CS) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * CS licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package org.orekit.gnss.metric.messages.rtcm;
18
19 import org.junit.Assert;
20 import org.junit.Test;
21 import org.orekit.gnss.metric.messages.rtcm.ephemeris.utils.AccuracyProvider;
22 import org.orekit.gnss.metric.messages.rtcm.ephemeris.utils.SignalInSpaceAccuracy;
23
24 public class SignalInSpaceAccuracyTest {
25
26 private final double eps = 0.01;
27
28 @Test
29 public void testAccuracy() {
30 AccuracyProvider ura;
31
32 // Index = 0
33 ura = new SignalInSpaceAccuracy(0);
34 Assert.assertEquals(0.0, ura.getAccuracy(), eps);
35 // Index = 25
36 ura = new SignalInSpaceAccuracy(25);
37 Assert.assertEquals(0.25, ura.getAccuracy(), eps);
38 // Index = 50
39 ura = new SignalInSpaceAccuracy(50);
40 Assert.assertEquals(0.50, ura.getAccuracy(), eps);
41 // Index = 60
42 ura = new SignalInSpaceAccuracy(60);
43 Assert.assertEquals(0.70, ura.getAccuracy(), eps);
44 // Index = 90
45 ura = new SignalInSpaceAccuracy(90);
46 Assert.assertEquals(1.60, ura.getAccuracy(), eps);
47 // Index = 115
48 ura = new SignalInSpaceAccuracy(115);
49 Assert.assertEquals(4.40, ura.getAccuracy(), eps);
50 // Index = 126
51 ura = new SignalInSpaceAccuracy(126);
52 Assert.assertEquals(-1.0, ura.getAccuracy(), eps);
53 }
54
55 }