sandbox-c/struct-location/location-test.c

26 lines
479 B
C

#include "location.h"
/*use assert()*/
#include <assert.h>
/*use strcmp*/
#include <string.h>
char lat[11]="+052.26594";
char lon[10]="+10.52673";
static void 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 lctnGet=getLocation(lat, lon);
assert(strcmp(lon, lctnGet.lon)==0 && "test_lct_lon()");
}
int main(){
test_lct_lat();
test_lct_lon();
}