Skip to content

Commit

Permalink
Minor fixes & refactor (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkufieta authored Sep 5, 2023
1 parent 44723e6 commit dda03f0
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 169 deletions.
8 changes: 4 additions & 4 deletions cartofacade/capi.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func NewCarto(cfg CartoConfig, acfg CartoAlgoConfig, vcl CartoLibInterface) (Car
return carto, nil
}

// Start is a wrapper for viam_carto_start
// start is a wrapper for viam_carto_start
func (vc *Carto) start() error {
status := C.viam_carto_start(vc.value)

Expand All @@ -197,7 +197,7 @@ func (vc *Carto) start() error {
return nil
}

// Stop is a wrapper for viam_carto_stop
// stop is a wrapper for viam_carto_stop
func (vc *Carto) stop() error {
status := C.viam_carto_stop(vc.value)

Expand All @@ -208,7 +208,7 @@ func (vc *Carto) stop() error {
return nil
}

// Terminate calls viam_carto_terminate to clean up memory for viam carto
// terminate calls viam_carto_terminate to clean up memory for viam carto
func (vc *Carto) terminate() error {
status := C.viam_carto_terminate(&vc.value)

Expand Down Expand Up @@ -326,7 +326,7 @@ func (vc *Carto) runFinalOptimization() error {
return nil
}

// this function is only used for testing purposes, but needs to be in this file as CGo is not supported in go test files
// getTestPositionResponse is only used for testing purposes, but needs to be in this file as CGo is not supported in go test files
func getTestPositionResponse() C.viam_carto_get_position_response {
gpr := C.viam_carto_get_position_response{}

Expand Down
8 changes: 4 additions & 4 deletions cartofacade/capi_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ type CartoMock struct {
RunFinalOptimizationFunc func() error
}

// Start calls the injected StartFunc or the real version.
// start calls the injected StartFunc or the real version.
func (cf *CartoMock) start() error {
if cf.StartFunc == nil {
return cf.Carto.start()
}
return cf.StartFunc()
}

// Stop calls the injected StopFunc or the real version.
// stop calls the injected StopFunc or the real version.
func (cf *CartoMock) stop() error {
if cf.StopFunc == nil {
return cf.Carto.stop()
}
return cf.StopFunc()
}

// Terminate calls the injected TerminateFunc or the real version.
// terminate calls the injected TerminateFunc or the real version.
func (cf *CartoMock) terminate() error {
if cf.TerminateFunc == nil {
return cf.Carto.terminate()
Expand Down Expand Up @@ -97,7 +97,7 @@ func (cf *CartoMock) internalState() ([]byte, error) {
return cf.InternalStateFunc()
}

// runFinalOptimization calls the injected GetInternalState or the real version.
// runFinalOptimization calls the injected RunFinalOptimization or the real version.
func (cf *CartoMock) runFinalOptimization() error {
if cf.RunFinalOptimizationFunc == nil {
return cf.Carto.runFinalOptimization()
Expand Down
Loading

0 comments on commit dda03f0

Please sign in to comment.