You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/07/08 21:20:10 UTC

[23/50] [abbrv] incubator-mynewt-core git commit: boot_serial; fix test code.

boot_serial; fix test code.


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/7dbc0d04
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/7dbc0d04
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/7dbc0d04

Branch: refs/heads/master
Commit: 7dbc0d0463db2db6c727e3a49fb1665dbbaa7a68
Parents: 6b829a0
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Fri Jun 24 17:21:54 2016 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Fri Jun 24 17:21:54 2016 -0700

----------------------------------------------------------------------
 libs/boot_serial/pkg.yml              | 1 +
 libs/boot_serial/src/test/boot_test.c | 8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7dbc0d04/libs/boot_serial/pkg.yml
----------------------------------------------------------------------
diff --git a/libs/boot_serial/pkg.yml b/libs/boot_serial/pkg.yml
index 0b66bb6..4a98343 100644
--- a/libs/boot_serial/pkg.yml
+++ b/libs/boot_serial/pkg.yml
@@ -29,6 +29,7 @@ pkg.deps:
     - hw/hal
     - libs/os
     - libs/testutil
+    - libs/bootutil
     - libs/util
 pkg.req_apis:
     - console

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7dbc0d04/libs/boot_serial/src/test/boot_test.c
----------------------------------------------------------------------
diff --git a/libs/boot_serial/src/test/boot_test.c b/libs/boot_serial/src/test/boot_test.c
index 3859b46..e11a649 100644
--- a/libs/boot_serial/src/test/boot_test.c
+++ b/libs/boot_serial/src/test/boot_test.c
@@ -26,8 +26,6 @@
 #include <util/base64.h>
 #include <util/crc16.h>
 #include <testutil/testutil.h>
-#include <newtmgr/newtmgr.h>
-#include <imgmgr/imgmgr.h>
 #include <hal/hal_flash.h>
 #include <hal/flash_map.h>
 
@@ -101,7 +99,7 @@ TEST_CASE(boot_serial_empty_img_msg)
     hdr = (struct nmgr_hdr *)buf;
     memset(hdr, 0, sizeof(*hdr));
     hdr->nh_op = NMGR_OP_WRITE;
-    hdr->nh_group = NMGR_GROUP_ID_IMAGE;
+    hdr->nh_group = htons(NMGR_GROUP_ID_IMAGE);
     hdr->nh_id = IMGMGR_NMGR_OP_UPLOAD;
     hdr->nh_len = htons(2);
     strcpy((char *)(hdr + 1), "{}");
@@ -126,7 +124,7 @@ TEST_CASE(boot_serial_img_msg)
     hdr = (struct nmgr_hdr *)buf;
     memset(hdr, 0, sizeof(*hdr));
     hdr->nh_op = NMGR_OP_WRITE;
-    hdr->nh_group = NMGR_GROUP_ID_IMAGE;
+    hdr->nh_group = htons(NMGR_GROUP_ID_IMAGE);
     hdr->nh_id = IMGMGR_NMGR_OP_UPLOAD;
 
     len = sprintf((char *)(hdr + 1), "{\"off\":0,\"len\":16,\"data\":\"%s\"}",
@@ -171,7 +169,7 @@ TEST_CASE(boot_serial_upload_bigger_image)
         hdr = (struct nmgr_hdr *)buf;
         memset(hdr, 0, sizeof(*hdr));
         hdr->nh_op = NMGR_OP_WRITE;
-        hdr->nh_group = NMGR_GROUP_ID_IMAGE;
+        hdr->nh_group = htons(NMGR_GROUP_ID_IMAGE);
         hdr->nh_id = IMGMGR_NMGR_OP_UPLOAD;
 
         if (off) {