Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2a333f6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "aconfig: fix broken test 'aconfig.test.cpp.test_mode:AconfigTest#ResetFlagValue'" into main

parents 35baf405 0bedc150
Loading
Loading
Loading
Loading
+14 −7
Original line number Original line Diff line number Diff line
@@ -19,13 +19,20 @@


using namespace com::android::aconfig::test;
using namespace com::android::aconfig::test;


TEST(AconfigTest, TestDisabledReadOnlyFlag) {
class AconfigTest : public ::testing::Test {
 protected:
  void SetUp() override {
    reset_flags();
  }
};

TEST_F(AconfigTest, TestDisabledReadOnlyFlag) {
  ASSERT_FALSE(com_android_aconfig_test_disabled_ro());
  ASSERT_FALSE(com_android_aconfig_test_disabled_ro());
  ASSERT_FALSE(provider_->disabled_ro());
  ASSERT_FALSE(provider_->disabled_ro());
  ASSERT_FALSE(disabled_ro());
  ASSERT_FALSE(disabled_ro());
}
}


TEST(AconfigTest, TestEnabledReadOnlyFlag) {
TEST_F(AconfigTest, TestEnabledReadOnlyFlag) {
  // TODO: change to assertTrue(enabledRo()) when the build supports reading tests/*.values
  // TODO: change to assertTrue(enabledRo()) when the build supports reading tests/*.values
  // (currently all flags are assigned the default READ_ONLY + DISABLED)
  // (currently all flags are assigned the default READ_ONLY + DISABLED)
  ASSERT_FALSE(com_android_aconfig_test_enabled_ro());
  ASSERT_FALSE(com_android_aconfig_test_enabled_ro());
@@ -33,13 +40,13 @@ TEST(AconfigTest, TestEnabledReadOnlyFlag) {
  ASSERT_FALSE(enabled_ro());
  ASSERT_FALSE(enabled_ro());
}
}


TEST(AconfigTest, TestDisabledReadWriteFlag) {
TEST_F(AconfigTest, TestDisabledReadWriteFlag) {
  ASSERT_FALSE(com_android_aconfig_test_disabled_rw());
  ASSERT_FALSE(com_android_aconfig_test_disabled_rw());
  ASSERT_FALSE(provider_->disabled_rw());
  ASSERT_FALSE(provider_->disabled_rw());
  ASSERT_FALSE(disabled_rw());
  ASSERT_FALSE(disabled_rw());
}
}


TEST(AconfigTest, TestEnabledReadWriteFlag) {
TEST_F(AconfigTest, TestEnabledReadWriteFlag) {
  // TODO: change to assertTrue(enabledRo()) when the build supports reading tests/*.values
  // TODO: change to assertTrue(enabledRo()) when the build supports reading tests/*.values
  // (currently all flags are assigned the default READ_ONLY + DISABLED)
  // (currently all flags are assigned the default READ_ONLY + DISABLED)
  ASSERT_FALSE(com_android_aconfig_test_enabled_rw());
  ASSERT_FALSE(com_android_aconfig_test_enabled_rw());
@@ -47,7 +54,7 @@ TEST(AconfigTest, TestEnabledReadWriteFlag) {
  ASSERT_FALSE(enabled_rw());
  ASSERT_FALSE(enabled_rw());
}
}


TEST(AconfigTest, TestEnabledFixedReadOnlyFlag) {
TEST_F(AconfigTest, TestEnabledFixedReadOnlyFlag) {
  // TODO: change to assertTrue(enabledFixedRo()) when the build supports reading tests/*.values
  // TODO: change to assertTrue(enabledFixedRo()) when the build supports reading tests/*.values
  // (currently all flags are assigned the default READ_ONLY + DISABLED)
  // (currently all flags are assigned the default READ_ONLY + DISABLED)
  ASSERT_FALSE(com_android_aconfig_test_enabled_fixed_ro());
  ASSERT_FALSE(com_android_aconfig_test_enabled_fixed_ro());
@@ -55,13 +62,13 @@ TEST(AconfigTest, TestEnabledFixedReadOnlyFlag) {
  ASSERT_FALSE(enabled_fixed_ro());
  ASSERT_FALSE(enabled_fixed_ro());
}
}


TEST(AconfigTest, OverrideFlagValue) {
TEST_F(AconfigTest, OverrideFlagValue) {
  ASSERT_FALSE(disabled_ro());
  ASSERT_FALSE(disabled_ro());
  disabled_ro(true);
  disabled_ro(true);
  ASSERT_TRUE(disabled_ro());
  ASSERT_TRUE(disabled_ro());
}
}


TEST(AconfigTest, ResetFlagValue) {
TEST_F(AconfigTest, ResetFlagValue) {
  ASSERT_FALSE(disabled_ro());
  ASSERT_FALSE(disabled_ro());
  ASSERT_FALSE(enabled_ro());
  ASSERT_FALSE(enabled_ro());
  disabled_ro(true);
  disabled_ro(true);