From 6967cbc959b079fa7e4411360e40e2a0ed65da29 Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Thu, 17 Nov 2011 13:24:32 -0800 Subject: Rename EntropyService to EntropyMixer EntropyService implies that this program provides entropy to other programs, and is misleading. The EntropyMixer class is designed purely to stir the existing entropy pool with some possibily random-ish data, and carryover entropy across device reboots. Change-Id: I086cd339a3b652d32371521e61e1b1f555ce2280 --- .../src/com/android/server/EntropyMixerTest.java | 41 ++++++++++++++++++++++ .../src/com/android/server/EntropyServiceTest.java | 41 ---------------------- 2 files changed, 41 insertions(+), 41 deletions(-) create mode 100644 services/tests/servicestests/src/com/android/server/EntropyMixerTest.java delete mode 100644 services/tests/servicestests/src/com/android/server/EntropyServiceTest.java (limited to 'services/tests') diff --git a/services/tests/servicestests/src/com/android/server/EntropyMixerTest.java b/services/tests/servicestests/src/com/android/server/EntropyMixerTest.java new file mode 100644 index 0000000..21a8ec2 --- /dev/null +++ b/services/tests/servicestests/src/com/android/server/EntropyMixerTest.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.server; + +import android.content.Context; +import android.os.FileUtils; +import android.test.AndroidTestCase; + +import java.io.File; + +/** + * Tests for {@link com.android.server.EntropyMixer} + */ +public class EntropyMixerTest extends AndroidTestCase { + + public void testInitialWrite() throws Exception { + File dir = getContext().getDir("testInitialWrite", Context.MODE_PRIVATE); + File file = File.createTempFile("testInitialWrite", "dat", dir); + file.deleteOnExit(); + assertEquals(0, FileUtils.readTextFile(file, 0, null).length()); + + // The constructor has the side effect of writing to file + new EntropyMixer("/dev/null", file.getCanonicalPath()); + + assertTrue(FileUtils.readTextFile(file, 0, null).length() > 0); + } +} diff --git a/services/tests/servicestests/src/com/android/server/EntropyServiceTest.java b/services/tests/servicestests/src/com/android/server/EntropyServiceTest.java deleted file mode 100644 index 636ba21..0000000 --- a/services/tests/servicestests/src/com/android/server/EntropyServiceTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.server; - -import android.content.Context; -import android.os.FileUtils; -import android.test.AndroidTestCase; - -import java.io.File; - -/** - * Tests for {@link com.android.server.EntropyService} - */ -public class EntropyServiceTest extends AndroidTestCase { - - public void testInitialWrite() throws Exception { - File dir = getContext().getDir("testInitialWrite", Context.MODE_PRIVATE); - File file = File.createTempFile("testInitialWrite", "dat", dir); - file.deleteOnExit(); - assertEquals(0, FileUtils.readTextFile(file, 0, null).length()); - - // The constructor has the side effect of writing to file - new EntropyService("/dev/null", file.getCanonicalPath()); - - assertTrue(FileUtils.readTextFile(file, 0, null).length() > 0); - } -} -- cgit v1.1