tests: add Common placeholder smoke/gtest tests and MockCoordTrans
This commit is contained in:
1 parent
90f7f8a474
commit
b75302083b
5 files changed
+80
No files matched your search
@@ -0,0 +1,5 @@
|
||||
add_library(MockCoordTrans STATIC MockCoordTrans.h)
|
||||
target_include_directories(MockCoordTrans PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# Export header-only semantics by providing an interface target
|
||||
add_library(MockCoordTrans::MockCoordTrans ALIAS MockCoordTrans)
|
||||
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
#include <utility>
|
||||
|
||||
// Minimal realistic mock for coordinate transforms used during migration.
|
||||
// Forward conversion returns approximate meters using lat/lon*111000.
|
||||
class MockCoordTrans {
|
||||
public:
|
||||
// approximate forward: (lat, lon) -> (x_m, y_m)
|
||||
static std::pair<double,double> forward(double lat_deg, double lon_deg) {
|
||||
return {lat_deg * 111000.0, lon_deg * 111000.0};
|
||||
}
|
||||
// approximate inverse
|
||||
static std::pair<double,double> inverse(double x_m, double y_m) {
|
||||
return {x_m / 111000.0, y_m / 111000.0};
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user