diff options
| author | Inseob Kim <inseob@google.com> | 2019-12-01 23:40:58 -0800 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2019-12-01 23:40:58 -0800 |
| commit | bef2b3b505447ba92ccae4b3d101b27c9d65923b (patch) | |
| tree | 5905c3c5ea1926dd78dcd0712abcf4ca339ecd68 | |
| parent | 9a645dec62b0f157dccb4e6dd7a59835381b12d9 (diff) | |
| parent | 5cc2f114a11c4321a27d2d9ea0ddf7a63bce494a (diff) | |
| download | platform_system_tools_sysprop-bef2b3b505447ba92ccae4b3d101b27c9d65923b.tar.gz platform_system_tools_sysprop-bef2b3b505447ba92ccae4b3d101b27c9d65923b.tar.bz2 platform_system_tools_sysprop-bef2b3b505447ba92ccae4b3d101b27c9d65923b.zip | |
Fix sysprop_test and add TEST_MAPPING am: 2d915f4f5b am: 78d12346e6
am: 5cc2f114a1
Change-Id: Ief2ce7147511a0fc286531830553917aa911bcf3
| -rw-r--r-- | Android.bp | 1 | ||||
| -rw-r--r-- | TEST_MAPPING | 7 | ||||
| -rw-r--r-- | tests/CppGenTest.cpp | 16 | ||||
| -rw-r--r-- | tests/JavaGenTest.cpp | 20 |
4 files changed, 26 insertions, 18 deletions
@@ -56,6 +56,7 @@ cc_test_host { "CppGen.cpp", "JavaGen.cpp", "tests/*.cpp"], + test_suites: ["general-tests"], } java_defaults { diff --git a/TEST_MAPPING b/TEST_MAPPING new file mode 100644 index 0000000..4cd7517 --- /dev/null +++ b/TEST_MAPPING @@ -0,0 +1,7 @@ +{ + "presubmit": [ + { + "name": "sysprop_test" + } + ] +} diff --git a/tests/CppGenTest.cpp b/tests/CppGenTest.cpp index 74dbc4c..45e1c65 100644 --- a/tests/CppGenTest.cpp +++ b/tests/CppGenTest.cpp @@ -44,14 +44,14 @@ prop { access: ReadWrite } prop { - api_name: "test.string" + api_name: "test_string" type: String prop_name: "android.test.string" scope: Public access: ReadWrite } prop { - api_name: "test.enum" + api_name: "test_enum" type: Enum prop_name: "android.test.enum" enum_values: "a|b|c|D|e|f|G" @@ -66,7 +66,7 @@ prop { access: Writeonce } prop { - api_name: "android.os_test-long" + api_name: "android_os_test-long" type: Long scope: Public access: ReadWrite @@ -84,7 +84,7 @@ prop { access: ReadWrite } prop { - api_name: "test.strlist" + api_name: "test_strlist" type: StringList scope: Public access: ReadWrite @@ -439,11 +439,11 @@ bool test_BOOLeaN(const std::optional<bool>& value) { } std::optional<std::int64_t> android_os_test_long() { - return GetProp<std::optional<std::int64_t>>("android.os_test-long"); + return GetProp<std::optional<std::int64_t>>("android_os_test-long"); } bool android_os_test_long(const std::optional<std::int64_t>& value) { - return __system_property_set("android.os_test-long", FormatValue(value).c_str()) == 0; + return __system_property_set("android_os_test-long", FormatValue(value).c_str()) == 0; } std::vector<std::optional<double>> test_double_list() { @@ -463,11 +463,11 @@ bool test_list_int(const std::vector<std::optional<std::int32_t>>& value) { } std::vector<std::optional<std::string>> test_strlist() { - return GetProp<std::vector<std::optional<std::string>>>("test.strlist"); + return GetProp<std::vector<std::optional<std::string>>>("test_strlist"); } bool test_strlist(const std::vector<std::optional<std::string>>& value) { - return __system_property_set("test.strlist", FormatValue(value).c_str()) == 0; + return __system_property_set("test_strlist", FormatValue(value).c_str()) == 0; } std::vector<std::optional<el_values>> el() { diff --git a/tests/JavaGenTest.cpp b/tests/JavaGenTest.cpp index a96d103..2b171ae 100644 --- a/tests/JavaGenTest.cpp +++ b/tests/JavaGenTest.cpp @@ -44,14 +44,14 @@ prop { access: ReadWrite } prop { - api_name: "test.string" + api_name: "test_string" type: String prop_name: "vendor.test.string" scope: Public access: ReadWrite } prop { - api_name: "test.enum" + api_name: "test_enum" type: Enum prop_name: "vendor.test.enum" enum_values: "a|b|c|D|e|f|G" @@ -66,7 +66,7 @@ prop { access: Writeonce } prop { - api_name: "vendor.os_test-long" + api_name: "vendor_os_test-long" type: Long scope: Public access: ReadWrite @@ -84,7 +84,7 @@ prop { access: ReadWrite } prop { - api_name: "test.strlist" + api_name: "test_strlist" type: StringList scope: Public access: ReadWrite @@ -227,7 +227,7 @@ public final class TestProperties { } public static Optional<Long> vendor_os_test_long() { - String value = SystemProperties.get("vendor.vendor.os_test-long"); + String value = SystemProperties.get("vendor.vendor_os_test-long"); return Optional.ofNullable(tryParseLong(value)); } @@ -238,7 +238,7 @@ public final class TestProperties { @Deprecated public static List<String> test_strlist() { - String value = SystemProperties.get("vendor.test.strlist"); + String value = SystemProperties.get("vendor.test_strlist"); return tryParseList(v -> tryParseString(v), value); } } @@ -418,12 +418,12 @@ public final class TestProperties { } public static Optional<Long> vendor_os_test_long() { - String value = SystemProperties.get("vendor.vendor.os_test-long"); + String value = SystemProperties.get("vendor.vendor_os_test-long"); return Optional.ofNullable(tryParseLong(value)); } public static void vendor_os_test_long(Long value) { - SystemProperties.set("vendor.vendor.os_test-long", value == null ? "" : value.toString()); + SystemProperties.set("vendor.vendor_os_test-long", value == null ? "" : value.toString()); } public static List<Double> test_double_list() { @@ -446,13 +446,13 @@ public final class TestProperties { @Deprecated public static List<String> test_strlist() { - String value = SystemProperties.get("vendor.test.strlist"); + String value = SystemProperties.get("vendor.test_strlist"); return tryParseList(v -> tryParseString(v), value); } @Deprecated public static void test_strlist(List<String> value) { - SystemProperties.set("vendor.test.strlist", value == null ? "" : formatList(value)); + SystemProperties.set("vendor.test_strlist", value == null ? "" : formatList(value)); } public static enum el_values { |
