Zhi Dou | af81e20 | 2023-06-14 20:38:20 +0000 | [diff] [blame] | 1 | import static com.android.aconfig.test.Flags.disabledRo; |
| 2 | import static com.android.aconfig.test.Flags.disabledRw; |
| 3 | import static com.android.aconfig.test.Flags.enabledRo; |
| 4 | import static com.android.aconfig.test.Flags.enabledRw; |
Mårten Kongstad | 9c59c31 | 2023-05-30 11:15:02 +0200 | [diff] [blame] | 5 | import static org.junit.Assert.assertFalse; |
| 6 | import static org.junit.Assert.assertTrue; |
| 7 | |
| 8 | import org.junit.Test; |
| 9 | import org.junit.runner.RunWith; |
| 10 | import org.junit.runners.JUnit4; |
| 11 | |
| 12 | @RunWith(JUnit4.class) |
| 13 | public final class AconfigTest { |
| 14 | @Test |
| 15 | public void testDisabledReadOnlyFlag() { |
Zhi Dou | af81e20 | 2023-06-14 20:38:20 +0000 | [diff] [blame] | 16 | assertFalse(disabledRo()); |
Mårten Kongstad | 9c59c31 | 2023-05-30 11:15:02 +0200 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | @Test |
| 20 | public void testEnabledReadOnlyFlag() { |
Zhi Dou | af81e20 | 2023-06-14 20:38:20 +0000 | [diff] [blame] | 21 | // TODO: change to assertTrue(enabledRo()) when the build supports reading tests/*.values |
Mårten Kongstad | 9c59c31 | 2023-05-30 11:15:02 +0200 | [diff] [blame] | 22 | // (currently all flags are assigned the default READ_ONLY + DISABLED) |
Zhi Dou | af81e20 | 2023-06-14 20:38:20 +0000 | [diff] [blame] | 23 | assertFalse(enabledRo()); |
Mårten Kongstad | 9c59c31 | 2023-05-30 11:15:02 +0200 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | @Test |
| 27 | public void testDisabledReadWriteFlag() { |
Zhi Dou | af81e20 | 2023-06-14 20:38:20 +0000 | [diff] [blame] | 28 | assertFalse(disabledRw()); |
Mårten Kongstad | 9c59c31 | 2023-05-30 11:15:02 +0200 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | @Test |
| 32 | public void testEnabledReadWriteFlag() { |
Zhi Dou | af81e20 | 2023-06-14 20:38:20 +0000 | [diff] [blame] | 33 | // TODO: change to assertTrue(enabledRw()) when the build supports reading tests/*.values |
Mårten Kongstad | 9c59c31 | 2023-05-30 11:15:02 +0200 | [diff] [blame] | 34 | // (currently all flags are assigned the default READ_ONLY + DISABLED) |
Zhi Dou | af81e20 | 2023-06-14 20:38:20 +0000 | [diff] [blame] | 35 | assertFalse(enabledRw()); |
Mårten Kongstad | 9c59c31 | 2023-05-30 11:15:02 +0200 | [diff] [blame] | 36 | } |
| 37 | } |