2 * Copyright 2014, Haiku, inc.
3 * Distributed under the terms of the MIT licence
7 #include "GeolocationTest.h"
9 #include <Geolocation.h>
11 #include <cppunit/TestCaller.h>
12 #include <cppunit/TestSuite.h>
15 using namespace BPrivate
;
18 GeolocationTest::GeolocationTest()
24 GeolocationTest::TestLocateSelf()
26 BGeolocation
locator(BUrl(
27 "https://location.services.mozilla.com/v1/geolocate?key=test"));
28 float latitude
, longitude
;
29 status_t result
= locator
.LocateSelf(latitude
, longitude
);
31 CPPUNIT_ASSERT_EQUAL(B_OK
, result
);
32 printf("Your position is: %f %f\n", latitude
, longitude
);
37 GeolocationTest::AddTests(BTestSuite
& parent
)
39 CppUnit::TestSuite
& suite
= *new CppUnit::TestSuite("GeolocationTest");
41 suite
.addTest(new CppUnit::TestCaller
<GeolocationTest
>(
42 "GeolocationTest::LocateSelf", &GeolocationTest::TestLocateSelf
));
44 parent
.addTest("GeolocationTest", &suite
);