Skip to content

Commit

Permalink
added GetRelState test which fails
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldsteinlechner committed Jan 31, 2024
1 parent aa4c6f8 commit fccd39e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 23 deletions.
6 changes: 6 additions & 0 deletions src/InstrumentPlatforms/CooTransformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,11 @@ public static partial class CooTransformation

[DllImport(@"CooTransformation.dll")]
public static extern int LatLonAlt2Xyz(string pcPlanet, double dLat, double dLon, double dAlt, ref double pdX, ref double pdY, ref double pdZ);

[DllImport(@"CooTransformation.dll")]
public static extern int GetRelState(string pcTargetBody, string pcObserverBody, string pcObserverTime, string pcOutputReferenceFrame,
ref double pdPosX, ref double pdPosY, ref double pdPosZ,
ref double pdVelX, ref double pdRelY, ref double pdVelZ);

}
}
51 changes: 28 additions & 23 deletions src/InstrumentPlatforms/JR.Wrappers.Tests/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,37 @@ let init () =

let tests =
testSequenced <| testList "init" [
test "InitDeInit" {
let i = init()
i.Dispose()
}
test "CorrectVersion" {
use _ = init()
let v = JR.CooTransformation.GetDllVersion()
Expect.equal v 2u "returned wrong version"
}
test "LatLonToXyz" {
use _ = init()
let init = JR.CooTransformation.AddSpiceKernel(spiceKernel)
Expect.equal 0 init "spice adding"
let mutable lat,lon,alt = 0.0,0.0,0.0
let result = JR.CooTransformation.Xyz2LatLonAlt("mars", 1.0, 1.0, 1.0, &lat, &lon, &alt)
Expect.equal 0 result "Xyz2LatLonAlt result code"
}
test "xyzToLatLon" {
test "InitDeInit" {
let i = init()
i.Dispose()
}
test "CorrectVersion" {
use _ = init()
let v = JR.CooTransformation.GetDllVersion()
Expect.equal v 2u "returned wrong version"
}

use _ = init()
let init = JR.CooTransformation.AddSpiceKernel(spiceKernel)
Expect.equal 0 init "spice adding"
let mutable px,py,pz = 0.0,0.0,0.0
let result = JR.CooTransformation.LatLonAlt2Xyz("MARS", 18.447, 77.402, 0, &px, &py, &pz)
printfn "%A" (py, py, pz)
Expect.equal 0 result "LatLonAlt2Xyz result code"
}

test "LatLonToXyz" {
let mutable lat,lon,alt = 0.0,0.0,0.0
let result = JR.CooTransformation.Xyz2LatLonAlt("mars", 1.0, 1.0, 1.0, &lat, &lon, &alt)
Expect.equal 0 result "Xyz2LatLonAlt result code"
}
test "xyzToLatLon" {
let mutable px,py,pz = 0.0,0.0,0.0
let result = JR.CooTransformation.LatLonAlt2Xyz("MARS", 18.447, 77.402, 0, &px, &py, &pz)
printfn "%A" (py, py, pz)
Expect.equal 0 result "LatLonAlt2Xyz result code"
}
test "GetRelState" {
let mutable px,py,pz = 0.0,0.0,0.0
let mutable vx,vy,vz = 0.0,0.0,0.0
let result = JR.CooTransformation.GetRelState("MARS", "MARS", "1988 June 13, 3:29:48", "IAU_MARS", &px, &py, &pz, &vx, &vy, &vz)
Expect.equal result 0 "GetRelState" // returns -1
}

]

Expand Down

0 comments on commit fccd39e

Please sign in to comment.