MYNEWT-560; conf_fcb_src() always set f_magic.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/c00eeee7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/c00eeee7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/c00eeee7 Branch: refs/heads/develop Commit: c00eeee7c4cdbe5dd474b03b95c8870d7eda20c9 Parents: 7944913 Author: Marko Kiiskila <ma...@runtime.io> Authored: Tue Feb 21 13:54:23 2017 -0800 Committer: Marko Kiiskila <ma...@runtime.io> Committed: Tue Feb 21 13:54:23 2017 -0800 ---------------------------------------------------------------------- sys/config/src/config_fcb.c | 2 -- sys/config/test-fcb/src/testcases/config_test_compress_reset.c | 2 ++ sys/config/test-fcb/src/testcases/config_test_empty_fcb.c | 1 + sys/config/test-fcb/src/testcases/config_test_save_1_fcb.c | 1 + sys/config/test-fcb/src/testcases/config_test_save_2_fcb.c | 1 + sys/config/test-fcb/src/testcases/config_test_save_3_fcb.c | 1 + sys/config/test-fcb/src/testcases/config_test_save_one_fcb.c | 1 + 7 files changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c00eeee7/sys/config/src/config_fcb.c ---------------------------------------------------------------------- diff --git a/sys/config/src/config_fcb.c b/sys/config/src/config_fcb.c index 334ae58..080ad45 100644 --- a/sys/config/src/config_fcb.c +++ b/sys/config/src/config_fcb.c @@ -29,7 +29,6 @@ #include "config/config_fcb.h" #include "config_priv.h" -#define CONF_FCB_MAGIC 0xc0ffeeee #define CONF_FCB_VERS 1 struct conf_fcb_load_cb_arg { @@ -51,7 +50,6 @@ conf_fcb_src(struct conf_fcb *cf) { int rc; - cf->cf_fcb.f_magic = CONF_FCB_MAGIC; cf->cf_fcb.f_version = CONF_FCB_VERS; cf->cf_fcb.f_scratch_cnt = 1; http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c00eeee7/sys/config/test-fcb/src/testcases/config_test_compress_reset.c ---------------------------------------------------------------------- diff --git a/sys/config/test-fcb/src/testcases/config_test_compress_reset.c b/sys/config/test-fcb/src/testcases/config_test_compress_reset.c index 46606f2..123d151 100644 --- a/sys/config/test-fcb/src/testcases/config_test_compress_reset.c +++ b/sys/config/test-fcb/src/testcases/config_test_compress_reset.c @@ -30,6 +30,7 @@ TEST_CASE(config_test_compress_reset) config_wipe_srcs(); config_wipe_fcb(fcb_areas, sizeof(fcb_areas) / sizeof(fcb_areas[0])); + cf.cf_fcb.f_magic = MYNEWT_VAL(CONFIG_FCB_MAGIC); cf.cf_fcb.f_sectors = fcb_areas; cf.cf_fcb.f_sector_cnt = sizeof(fcb_areas) / sizeof(fcb_areas[0]); @@ -72,6 +73,7 @@ TEST_CASE(config_test_compress_reset) memset(&cf, 0, sizeof(cf)); + cf.cf_fcb.f_magic = MYNEWT_VAL(CONFIG_FCB_MAGIC); cf.cf_fcb.f_sectors = fcb_areas; cf.cf_fcb.f_sector_cnt = sizeof(fcb_areas) / sizeof(fcb_areas[0]); http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c00eeee7/sys/config/test-fcb/src/testcases/config_test_empty_fcb.c ---------------------------------------------------------------------- diff --git a/sys/config/test-fcb/src/testcases/config_test_empty_fcb.c b/sys/config/test-fcb/src/testcases/config_test_empty_fcb.c index a72d1c5..d6c1fd9 100644 --- a/sys/config/test-fcb/src/testcases/config_test_empty_fcb.c +++ b/sys/config/test-fcb/src/testcases/config_test_empty_fcb.c @@ -26,6 +26,7 @@ TEST_CASE(config_test_empty_fcb) config_wipe_srcs(); config_wipe_fcb(fcb_areas, sizeof(fcb_areas) / sizeof(fcb_areas[0])); + cf.cf_fcb.f_magic = MYNEWT_VAL(CONFIG_FCB_MAGIC); cf.cf_fcb.f_sectors = fcb_areas; cf.cf_fcb.f_sector_cnt = sizeof(fcb_areas) / sizeof(fcb_areas[0]); http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c00eeee7/sys/config/test-fcb/src/testcases/config_test_save_1_fcb.c ---------------------------------------------------------------------- diff --git a/sys/config/test-fcb/src/testcases/config_test_save_1_fcb.c b/sys/config/test-fcb/src/testcases/config_test_save_1_fcb.c index 68dc711..e49386a 100644 --- a/sys/config/test-fcb/src/testcases/config_test_save_1_fcb.c +++ b/sys/config/test-fcb/src/testcases/config_test_save_1_fcb.c @@ -25,6 +25,7 @@ TEST_CASE(config_test_save_1_fcb) config_wipe_srcs(); + cf.cf_fcb.f_magic = MYNEWT_VAL(CONFIG_FCB_MAGIC); cf.cf_fcb.f_sectors = fcb_areas; cf.cf_fcb.f_sector_cnt = sizeof(fcb_areas) / sizeof(fcb_areas[0]); http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c00eeee7/sys/config/test-fcb/src/testcases/config_test_save_2_fcb.c ---------------------------------------------------------------------- diff --git a/sys/config/test-fcb/src/testcases/config_test_save_2_fcb.c b/sys/config/test-fcb/src/testcases/config_test_save_2_fcb.c index ade741a..bfdcc21 100644 --- a/sys/config/test-fcb/src/testcases/config_test_save_2_fcb.c +++ b/sys/config/test-fcb/src/testcases/config_test_save_2_fcb.c @@ -27,6 +27,7 @@ TEST_CASE(config_test_save_2_fcb) config_wipe_srcs(); + cf.cf_fcb.f_magic = MYNEWT_VAL(CONFIG_FCB_MAGIC); cf.cf_fcb.f_sectors = fcb_areas; cf.cf_fcb.f_sector_cnt = sizeof(fcb_areas) / sizeof(fcb_areas[0]); http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c00eeee7/sys/config/test-fcb/src/testcases/config_test_save_3_fcb.c ---------------------------------------------------------------------- diff --git a/sys/config/test-fcb/src/testcases/config_test_save_3_fcb.c b/sys/config/test-fcb/src/testcases/config_test_save_3_fcb.c index 3cb7cee..99d79ef 100644 --- a/sys/config/test-fcb/src/testcases/config_test_save_3_fcb.c +++ b/sys/config/test-fcb/src/testcases/config_test_save_3_fcb.c @@ -27,6 +27,7 @@ TEST_CASE(config_test_save_3_fcb) config_wipe_srcs(); config_wipe_fcb(fcb_areas, sizeof(fcb_areas) / sizeof(fcb_areas[0])); + cf.cf_fcb.f_magic = MYNEWT_VAL(CONFIG_FCB_MAGIC); cf.cf_fcb.f_sectors = fcb_areas; cf.cf_fcb.f_sector_cnt = 4; http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c00eeee7/sys/config/test-fcb/src/testcases/config_test_save_one_fcb.c ---------------------------------------------------------------------- diff --git a/sys/config/test-fcb/src/testcases/config_test_save_one_fcb.c b/sys/config/test-fcb/src/testcases/config_test_save_one_fcb.c index a9a5efc..90e17d9 100644 --- a/sys/config/test-fcb/src/testcases/config_test_save_one_fcb.c +++ b/sys/config/test-fcb/src/testcases/config_test_save_one_fcb.c @@ -26,6 +26,7 @@ TEST_CASE(config_test_save_one_fcb) config_wipe_srcs(); config_wipe_fcb(fcb_areas, sizeof(fcb_areas) / sizeof(fcb_areas[0])); + cf.cf_fcb.f_magic = MYNEWT_VAL(CONFIG_FCB_MAGIC); cf.cf_fcb.f_sectors = fcb_areas; cf.cf_fcb.f_sector_cnt = sizeof(fcb_areas) / sizeof(fcb_areas[0]);