repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / tests / kits / shared / GeolocationTest.cpp
blobadcc5e757127aa2ddb2d9307d1396310ef90e48c
1 /*
2 * Copyright 2014, Haiku, inc.
3 * Distributed under the terms of the MIT licence
4 */
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()
23 void
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);
36 /* static */ void
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);