forked from upstream-mirrors/OpenTracks
merge heads
This commit is contained in:
+7
-6
@@ -17,23 +17,23 @@ public class SensorManagerFactoryTest extends AndroidTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
|
||||
sharedPreferences = getContext().getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
// Let's use default values.
|
||||
sharedPreferences.edit().clear().apply();
|
||||
}
|
||||
|
||||
|
||||
@SmallTest
|
||||
public void testDefaultSettings() throws Exception {
|
||||
assertNull(SensorManagerFactory.getSensorManager(getContext()));
|
||||
assertNull(SensorManagerFactory.getInstance().getSensorManager(getContext()));
|
||||
}
|
||||
|
||||
|
||||
@SmallTest
|
||||
public void testCreateZephyr() throws Exception {
|
||||
assertClassForName(ZephyrSensorManager.class, R.string.sensor_type_value_zephyr);
|
||||
}
|
||||
|
||||
|
||||
@SmallTest
|
||||
public void testCreateAnt() throws Exception {
|
||||
assertClassForName(AntDirectSensorManager.class, R.string.sensor_type_value_ant);
|
||||
@@ -49,8 +49,9 @@ public class SensorManagerFactoryTest extends AndroidTestCase {
|
||||
.putString(getContext().getString(R.string.sensor_type_key),
|
||||
getContext().getString(i))
|
||||
.apply();
|
||||
SensorManager sm = SensorManagerFactory.getSensorManager(getContext());
|
||||
SensorManager sm = SensorManagerFactory.getInstance().getSensorManager(getContext());
|
||||
assertNotNull(sm);
|
||||
assertTrue(c.isInstance(sm));
|
||||
SensorManagerFactory.getInstance().releaseSensorManager(sm);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user