EXPECT_NE(ret, 0);
}
+TEST(PassParserTest, pass_parser_get_each_resource_config_valid) {
+ struct pass pass;
+ const char path_json[] = "./scripts/valid/pass.json";
+ unsigned int i;
+
+ int ret = pass_parser_get_resource_config(&pass, path_json);
+ ASSERT_EQ(ret, 0);
+
+ for (i = 0; i < pass.num_resources; i++) {
+ struct pass_resource *res = &pass.res[i];
+
+ ret = pass_parser_get_each_resource_config(res,
+ res->config_data.path_conf_file);
+ EXPECT_EQ(ret, 0);
+ if (ret < 0)
+ goto err;
+ }
+
+ for (i = 0; i < pass.num_resources; i++)
+ pass_parser_put_each_resource_config(&pass.res[i]);
+ pass_parser_put_resource_config(&pass);
+
+ return;
+err:
+ for (i--; i >= 0; i--)
+ pass_parser_put_each_resource_config(&pass.res[i]);
+ pass_parser_put_resource_config(&pass);
+}
+
int main(int argc, char *argv[])
{
try {
--- /dev/null
+{
+ "support" : true,
+ "init_level" : 0,
+ "level_list" :
+ [
+ {
+ "level" : 0,
+ "battery,charging_status" : 0, // POWER_SUPPLY_STATUS_UNKNOWN
+ "battery_charging_currnt_uA" : 2048000
+ }, {
+ "level" : 1,
+ "battery,charging_status" : 0, // POWER_SUPPLY_STATUS_UNKNOWN
+ "battery,charging_currnt_uA" : 1024000
+ }, {
+ "level" : 2,
+ "battery,charging_status" : 3, // POWER_SUPPLY_STATUS_NOT_CHARGING
+ "battery,charging_currnt_uA" : 1024000
+ }
+ ],
+
+ "pmqos_support" :false,
+
+ "thermal_support" : true,
+ "thermal_timer_interval_ms" : 5000,
+ "thermal_scenario_list":
+ [
+ {
+ "name" : "Release",
+ "temperature" : { "start": 0, "end": 45, "threshold": 42},
+ "timer_interval_ms" : 5000,
+ "target_level" : 0
+ }, {
+ "name" : "Warning",
+ "temperature" : { "start": 45, "end": 50, "threshold": 47},
+ "timer_interval_ms" : 3000,
+ "target_level" : 1
+ }, {
+ "name" : "LimitAction",
+ "temperature" : { "start": 50, "end": 55, "threshold": 52},
+ "timer_interval_ms" : 1000,
+ "target_level" : 2
+ }, {
+ "name" : "Shutdown",
+ "temperature" : { "start": 55, "end": 100 },
+ "timer_interval_ms" : 1000,
+ "target_level" : 2
+ }
+ ],
+
+ "cpuhp_support" : false
+}
--- /dev/null
+{
+ "support" : true,
+ "init_level" : 0,
+ "level_list" :
+ [
+ {
+ "level" : 0,
+ "dvfs,minimum_frequency_khz" : 138000000,
+ "dvfs,maximum_frequency_khz" : 413000000
+ }, {
+ "level" : 1,
+ "dvfs,minimum_frequency_khz" : 138000000,
+ "dvfs,maximum_frequency_khz" : 138000000
+ }, {
+ "level" : 2,
+ "dvfs,minimum_frequency_khz" : 138000000,
+ "dvfs,maximum_frequency_khz" : 275000000
+ }, {
+ "level" : 3,
+ "dvfs,minimum_frequency_khz" : 413000000,
+ "dvfs,maximum_frequency_khz" : 413000000
+ }
+ ],
+
+ "pmqos_support" : true,
+ "pmqos_scenario_list":
+ [
+ {
+ "name" : "AppLaunch",
+ "target_level" : 3
+ }, {
+ "name" : "UltraPowerSaving",
+ "target_level" : 1
+ }, {
+ "name" : "Doze",
+ "target_level" : 2
+ }, {
+ "name" : "Performance",
+ "target_level" : 3
+ }
+ ],
+
+ "thermal_support" : false,
+
+ "cpuhp_support" : false
+}
--- /dev/null
+{
+ "support" : true,
+ "init_level" : 0,
+ "level_list" :
+ [
+ {
+ "level" : 0,
+ "dvfs,minimum_frequency_khz" : 200000000,
+ "dvfs,maximum_frequency_khz" : 600000000
+ }, {
+ "level" : 1,
+ "dvfs,minimum_frequency_khz" : 200000000,
+ "dvfs,maximum_frequency_khz" : 200000000
+ }, {
+ "level" : 2,
+ "dvfs,minimum_frequency_khz" : 200000000,
+ "dvfs,maximum_frequency_khz" : 400000000
+ }, {
+ "level" : 3,
+ "dvfs,minimum_frequency_khz" : 400000000,
+ "dvfs,maximum_frequency_khz" : 400000000
+ }, {
+ "level" : 4,
+ "dvfs,minimum_frequency_khz" : 600000000,
+ "dvfs,maximum_frequency_khz" : 600000000
+ }
+ ],
+
+ "pmqos_support" : true,
+ "pmqos_scenario_list":
+ [
+ {
+ "name" : "AppLaunch",
+ "target_level" : 3
+ }, {
+ "name" : "UltraPowerSaving",
+ "target_level" : 1
+ }, {
+ "name" : "Doze",
+ "target_level" : 2
+ }, {
+ "name" : "Performance",
+ "target_level" : 4
+ }
+ ],
+
+ "thermal_support" : false,
+
+ "cpuhp_support" : false
+}
--- /dev/null
+{
+ "support" : true,
+ "init_level" : 0,
+ "level_list" :
+ [
+ {
+ "level" : 0,
+ "dvfs,minimum_frequency_khz" : 600000,
+ "dvfs,maximum_frequency_khz" : 1500000
+ }, {
+ "level" : 1,
+ "dvfs,minimum_frequency_khz" : 1500000,
+ "dvfs,maximum_frequency_khz" : 1500000
+ }, {
+ "level" : 2,
+ "dvfs,minimum_frequency_khz" : 600000,
+ "dvfs,maximum_frequency_khz" : 600000
+ }
+ ],
+
+ "pmqos_support" : true,
+ "pmqos_scenario_list":
+ [
+ {
+ "name" : "AppLaunch",
+ "target_level" : 1
+ }, {
+ "name" : "UltraPowerSaving",
+ "target_level" : 2
+ }, {
+ "name" : "Performance",
+ "target_level" : 1
+ }
+ ],
+
+ "thermal_support" : true,
+ "thermal_timer_interval_ms" : 5000,
+ "thermal_scenario_list":
+ [
+ {
+ "name" : "Release",
+ "temperature" : { "start": 0, "end": 75, "threshold": 72},
+ "timer_interval_ms" : 5000,
+ "target_level" : 0
+ }, {
+ "name" : "Warning",
+ "temperature" : { "start": 75, "end": 80, "threshold": 77 },
+ "timer_interval_ms" : 3000,
+ "target_level" : 0
+ }, {
+ "name" : "LimitAction",
+ "temperature" : { "start": 80, "end": 85, "threshold": 82 },
+ "timer_interval_ms" : 1000,
+ "target_level" : 2
+ }, {
+ "name" : "Shutdown",
+ "temperature" : { "start": 85, "end": 100 },
+ "timer_interval_ms" : 1000,
+ "target_level" : 2
+ }
+ ],
+
+ "cpuhp_support" : false
+}
--- /dev/null
+{
+ "support" : true,
+ "init_level" : 0,
+ "level_list" :
+ [
+ {
+ "level" : 0,
+ "dvfs,minimum_frequency_khz" : 600000,
+ "dvfs,maximum_frequency_khz" : 1500000
+ }, {
+ "level" : 1,
+ "dvfs,minimum_frequency_khz" : 1500000,
+ "dvfs,maximum_frequency_khz" : 1500000
+ }, {
+ "level" : 2,
+ "dvfs,minimum_frequency_khz" : 600000,
+ "dvfs,maximum_frequency_khz" : 600000
+ }
+ ],
+
+ "pmqos_support" : true,
+ "pmqos_scenario_list":
+ [
+ {
+ "name" : "AppLaunch",
+ "target_level" : 1
+ }, {
+ "name" : "UltraPowerSaving",
+ "target_level" : 2
+ }, {
+ "name" : "Performance",
+ "target_level" : 1
+ }
+ ],
+
+ "thermal_support" : true,
+ "thermal_timer_interval_ms" : 5000,
+ "thermal_scenario_list":
+ [
+ {
+ "name" : "Release",
+ "temperature" : { "start": 0, "end": 75, "threshold": 72},
+ "timer_interval_ms" : 5000,
+ "target_level" : 0
+ }, {
+ "name" : "Warning",
+ "temperature" : { "start": 75, "end": 80, "threshold": 77 },
+ "timer_interval_ms" : 3000,
+ "target_level" : 0
+ }, {
+ "name" : "LimitAction",
+ "temperature" : { "start": 80, "end": 85, "threshold": 82 },
+ "timer_interval_ms" : 1000,
+ "target_level" : 2
+ }, {
+ "name" : "Shutdown",
+ "temperature" : { "start": 85, "end": 100 },
+ "timer_interval_ms" : 1000,
+ "target_level" : 2
+ }
+ ],
+
+ "cpuhp_support" : false
+}
--- /dev/null
+{
+ "support" : true,
+ "init_level" : 0,
+ "level_list" :
+ [
+ {
+ "level" : 0,
+ "dvfs,minimum_frequency_khz" : 100000000,
+ "dvfs,maximum_frequency_khz" : 800000000
+ }, {
+ "level" : 1,
+ "dvfs,minimum_frequency_khz" : 100000000,
+ "dvfs,maximum_frequency_khz" : 200000000
+ }, {
+ "level" : 2,
+ "dvfs,minimum_frequency_khz" : 600000000,
+ "dvfs,maximum_frequency_khz" : 80000000
+ }, {
+ "level" : 3,
+ "dvfs,minimum_frequency_khz" : 100000000,
+ "dvfs,maximum_frequency_khz" : 400000000
+ }, {
+ "level" : 4,
+ "dvfs,minimum_frequency_khz" : 100000000,
+ "dvfs,maximum_frequency_khz" : 600000000
+ }, {
+ "level" : 5,
+ "dvfs,minimum_frequency_khz" : 800000000,
+ "dvfs,maximum_frequency_khz" : 800000000
+ }
+ ],
+
+ "pmqos_support" : true,
+ "pmqos_scenario_list":
+ [
+ {
+ "name" : "AppLaunch",
+ "target_level" : 2
+ }, {
+ "name" : "UltraPowerSaving",
+ "target_level" : 1
+ }, {
+ "name" : "Doze",
+ "target_level" : 3
+ }, {
+ "name" : "Performance",
+ "target_level" : 2
+ }
+ ],
+
+ "thermal_support" : true,
+ "thermal_timer_interval_ms" : 5000,
+ "thermal_scenario_list":
+ [
+ {
+ "name" : "Release",
+ "temperature" : { "start": 0, "end": 75, "threshold": 72},
+ "timer_interval_ms" : 5000,
+ "target_level" : 0
+ }, {
+ "name" : "Warning",
+ "temperature" : { "start": 75, "end": 85, "threshold": 77 },
+ "timer_interval_ms" : 3000,
+ "target_level" : 0
+ }, {
+ "name" : "LimitAction",
+ "temperature" : { "start": 85, "end": 95, "threshold": 87 },
+ "timer_interval_ms" : 1000,
+ "target_level" : 4
+ }, {
+ "name" : "Shutdown",
+ "temperature" : { "start": 95, "end": 100 },
+ "timer_interval_ms" : 1000,
+ "target_level" : 3
+ }
+ ],
+
+ "cpuhp_support" : false
+}
--- /dev/null
+{
+ "support" : true,
+ "init_level" : 0,
+ "level_list" :
+ [
+ {
+ "level" : 0,
+ "memory,fault_around_bytes" : 4096
+ }, {
+ "level" : 1,
+ "memory,fault_around_bytes" : 65536
+ }
+ ],
+
+ "pmqos_support" : true,
+ "pmqos_scenario_list" :
+ [
+ {
+ "name" : "AppLaunch",
+ "target_level" : 0
+ }, {
+ "name" : "UltraPowerSaving",
+ "target_level" : 0
+ }, {
+ "name" : "Performance",
+ "target_level" : 1
+ }
+ ],
+
+ "thermal_support" : false,
+
+ "cpuhp_support" : false
+}