Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksanford committed Jul 3, 2023
1 parent 67eb067 commit 929c2ff
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cartofacade/capi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func confirmBinaryCompressedUnsupported(t *testing.T) {
test.That(t, err.Error(), test.ShouldResemble, "compressed PCD not yet implemented")
}

func testAddSensorReading(t *testing.T, vc Carto, sensor, pcdPath string, timestamp time.Time, pcdType pointcloud.PCDType) {
func testAddSensorReading(t *testing.T, vc Carto, pcdPath string, timestamp time.Time, pcdType pointcloud.PCDType) {
file, err := os.Open(artifact.MustPath(pcdPath))
test.That(t, err, test.ShouldBeNil)

Expand All @@ -49,7 +49,7 @@ func testAddSensorReading(t *testing.T, vc Carto, sensor, pcdPath string, timest
err = pointcloud.ToPCD(pc, buf, pcdType)
test.That(t, err, test.ShouldBeNil)

err = vc.addSensorReading(sensor, buf.Bytes(), timestamp)
err = vc.addSensorReading("mysensor", buf.Bytes(), timestamp)
test.That(t, err, test.ShouldBeNil)
}

Expand Down Expand Up @@ -194,7 +194,7 @@ func TestCGoAPI(t *testing.T) {
// 1. test valid addSensorReading: valid reading ascii
t.Log("sensor reading 1")
timestamp = timestamp.Add(time.Second * 2)
testAddSensorReading(t, vc, "mysensor", "viam-cartographer/mock_lidar/0.pcd", timestamp, pointcloud.PCDAscii)
testAddSensorReading(t, vc, "viam-cartographer/mock_lidar/0.pcd", timestamp, pointcloud.PCDAscii)

// test getPosition zeroed if not enough sensor data has been provided
position, err := vc.getPosition()
Expand All @@ -217,7 +217,7 @@ func TestCGoAPI(t *testing.T) {
// 2. test valid addSensorReading: valid reading binary
t.Log("sensor reading 2")
timestamp = timestamp.Add(time.Second * 2)
testAddSensorReading(t, vc, "mysensor", "viam-cartographer/mock_lidar/1.pcd", timestamp, pointcloud.PCDBinary)
testAddSensorReading(t, vc, "viam-cartographer/mock_lidar/1.pcd", timestamp, pointcloud.PCDBinary)

// test getPosition zeroed
position, err = vc.getPosition()
Expand All @@ -236,7 +236,7 @@ func TestCGoAPI(t *testing.T) {
// third sensor reading populates the pointcloud map and the position
t.Log("sensor reading 3")
timestamp = timestamp.Add(time.Second * 2)
testAddSensorReading(t, vc, "mysensor", "viam-cartographer/mock_lidar/2.pcd", timestamp, pointcloud.PCDBinary)
testAddSensorReading(t, vc, "viam-cartographer/mock_lidar/2.pcd", timestamp, pointcloud.PCDBinary)

// test getPosition, is no longer zeroed
position, err = vc.getPosition()
Expand All @@ -259,7 +259,7 @@ func TestCGoAPI(t *testing.T) {
// third sensor reading populates the pointcloud map and the position
t.Log("sensor reading 3")
timestamp = timestamp.Add(time.Second * 2)
testAddSensorReading(t, vc, "mysensor", "viam-cartographer/mock_lidar/2.pcd", timestamp, pointcloud.PCDBinary)
testAddSensorReading(t, vc, "viam-cartographer/mock_lidar/2.pcd", timestamp, pointcloud.PCDBinary)

// test getPosition, is no longer zeroed
position, err = vc.getPosition()
Expand Down

0 comments on commit 929c2ff

Please sign in to comment.