feat: adjust struct-location

This commit is contained in:
dancingCycle 2023-01-03 13:38:02 +01:00
parent c483541c29
commit 6447c61b1c
1 changed files with 7 additions and 10 deletions

View File

@ -6,20 +6,17 @@
/*use strcmp*/
#include <string.h>
char lat[11]="+052.26594";
char lon[10]="+10.52673";
static void test_lct_lat(){
struct location lctn;
strcpy(lctn.lat, "+052.26594");
strcpy(lctn.lon, "+10.52673");
struct location lctnGet=getLocation(lctn.lat, lctn.lon);
assert(strcmp(lctn.lat, lctnGet.lat)==0 && "test_lct_lat()");
struct location lctnGet=getLocation(lat, lon);
assert(strcmp(lat, lctnGet.lat)==0 && "test_lct_lat()");
}
static void test_lct_lon(){
struct location lctn;
strcpy(lctn.lat, "+052.26594");
strcpy(lctn.lon, "+10.52673");
struct location lctnGet=getLocation(lctn.lat, lctn.lon);
assert(strcmp(lctn.lat, lctnGet.lat)==0 && "test_lct_lon()");
struct location lctnGet=getLocation(lat, lon);
assert(strcmp(lon, lctnGet.lon)==0 && "test_lct_lon()");
}
int main(){