You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by st...@apache.org on 2016/09/29 01:54:08 UTC
incubator-mynewt-core git commit: newt test all compiling again.
Repository: incubator-mynewt-core
Updated Branches:
refs/heads/develop ac676a909 -> 040aa6f23
newt test all compiling again.
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/040aa6f2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/040aa6f2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/040aa6f2
Branch: refs/heads/develop
Commit: 040aa6f2321600aa46c8cc1c91b41385c6e95269
Parents: ac676a9
Author: Sterling Hughes <st...@apache.org>
Authored: Wed Sep 28 18:54:02 2016 -0700
Committer: Sterling Hughes <st...@apache.org>
Committed: Wed Sep 28 18:54:02 2016 -0700
----------------------------------------------------------------------
apps/slinky/pkg.yml | 2 +-
boot/boot_serial/pkg.yml | 2 +-
boot/boot_serial/test/pkg.yml | 8 +-
boot/boot_serial/test/src/boot_test.c | 4 +-
crypto/mbedtls/test/pkg.yml | 4 +-
encoding/base64/test/pkg.yml | 6 +-
encoding/base64/test/src/hex_test.c | 2 +-
hw/hal/test/pkg.yml | 4 +-
libs/util/test/pkg.yml | 30 -------
libs/util/test/src/hex_test.c | 125 ----------------------------
libs/util/test/src/util_test.c | 53 ------------
libs/util/test/src/util_test_priv.h | 26 ------
net/ip/mn_socket/test/pkg.yml | 6 +-
net/nimble/host/test/pkg.yml | 4 +-
sys/config/pkg.yml | 1 +
sys/config/test/pkg.yml | 6 +-
sys/log/test/pkg.yml | 4 +-
util/cbmem/test/src/util_test.c | 10 +--
util/crc/test/pkg.yml | 30 -------
util/crc/test/src/encoding_test.c | 46 ----------
util/crc/test/src/encoding_test_priv.h | 25 ------
util/crc/test/src/hex_test.c | 125 ----------------------------
22 files changed, 28 insertions(+), 495 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/apps/slinky/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/slinky/pkg.yml b/apps/slinky/pkg.yml
index 3d4f7a4..c203015 100644
--- a/apps/slinky/pkg.yml
+++ b/apps/slinky/pkg.yml
@@ -43,7 +43,7 @@ pkg.deps.CONFIG_NFFS:
- fs/nffs
pkg.deps.CONFIG_FCB:
- - sys/fcb
+ - fs/fcb
pkg.syscfg_vals:
# Enable the shell task.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/boot/boot_serial/pkg.yml
----------------------------------------------------------------------
diff --git a/boot/boot_serial/pkg.yml b/boot/boot_serial/pkg.yml
index b2a9308..7921360 100644
--- a/boot/boot_serial/pkg.yml
+++ b/boot/boot_serial/pkg.yml
@@ -17,7 +17,7 @@
# under the License.
#
-pkg.name: libs/boot_serial
+pkg.name: boot/boot_serial
pkg.description: The boot_serial library is used when downloading image over serial port.
pkg.author: "Apache Mynewt <de...@mynewt.incubator.apache.org>"
pkg.homepage: "http://mynewt.apache.org/"
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/boot/boot_serial/test/pkg.yml
----------------------------------------------------------------------
diff --git a/boot/boot_serial/test/pkg.yml b/boot/boot_serial/test/pkg.yml
index 561c94b..21a4a09 100644
--- a/boot/boot_serial/test/pkg.yml
+++ b/boot/boot_serial/test/pkg.yml
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
#
-pkg.name: libs/boot_serial/test
+pkg.name: boot/boot_serial/test
pkg.type: unittest
pkg.description: "Boot serial unit tests."
pkg.author: "Apache Mynewt <de...@mynewt.incubator.apache.org>"
@@ -23,11 +23,11 @@ pkg.homepage: "http://mynewt.apache.org/"
pkg.keywords:
pkg.deps:
- - libs/boot_serial
- - libs/testutil
+ - boot/boot_serial
+ - test/testutil
pkg.deps.SELFTEST:
- - libs/console/stub
+ - sys/console/stub
pkg.syscfg_vals.SELFTEST:
CONFIG_FCB: 1
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/boot/boot_serial/test/src/boot_test.c
----------------------------------------------------------------------
diff --git a/boot/boot_serial/test/src/boot_test.c b/boot/boot_serial/test/src/boot_test.c
index a70f05e..83411a6 100644
--- a/boot/boot_serial/test/src/boot_test.c
+++ b/boot/boot_serial/test/src/boot_test.c
@@ -24,8 +24,8 @@
#include <string.h>
#include <inttypes.h>
#include "syscfg/syscfg.h"
-#include "encoding/base64.h"
-#include "encoding/crc16.h"
+#include "base64/base64.h"
+#include "crc/crc16.h"
#include "testutil/testutil.h"
#include "hal/hal_flash.h"
#include "hal/flash_map.h"
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/crypto/mbedtls/test/pkg.yml
----------------------------------------------------------------------
diff --git a/crypto/mbedtls/test/pkg.yml b/crypto/mbedtls/test/pkg.yml
index dd18908..8680717 100644
--- a/crypto/mbedtls/test/pkg.yml
+++ b/crypto/mbedtls/test/pkg.yml
@@ -24,7 +24,7 @@ pkg.keywords:
pkg.deps:
- crypto/mbedtls
- - libs/testutil
+ - test/testutil
pkg.deps.SELFTEST:
- - libs/console/stub
+ - sys/console/stub
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/encoding/base64/test/pkg.yml
----------------------------------------------------------------------
diff --git a/encoding/base64/test/pkg.yml b/encoding/base64/test/pkg.yml
index 9ecd063..4496166 100644
--- a/encoding/base64/test/pkg.yml
+++ b/encoding/base64/test/pkg.yml
@@ -23,8 +23,8 @@ pkg.homepage: "http://mynewt.apache.org/"
pkg.keywords:
pkg.deps:
- - libs/testutil
- - libs/util
+ - test/testutil
+ - encoding/base64
pkg.deps.SELFTEST:
- - libs/console/stub
+ - sys/console/stub
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/encoding/base64/test/src/hex_test.c
----------------------------------------------------------------------
diff --git a/encoding/base64/test/src/hex_test.c b/encoding/base64/test/src/hex_test.c
index 8183425..471a14e 100644
--- a/encoding/base64/test/src/hex_test.c
+++ b/encoding/base64/test/src/hex_test.c
@@ -20,7 +20,7 @@
#include <string.h>
#include "testutil/testutil.h"
-#include "util/hex.h"
+#include "base64/hex.h"
TEST_CASE(hex2str)
{
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/hw/hal/test/pkg.yml
----------------------------------------------------------------------
diff --git a/hw/hal/test/pkg.yml b/hw/hal/test/pkg.yml
index 943c0b3..a60fb4d 100644
--- a/hw/hal/test/pkg.yml
+++ b/hw/hal/test/pkg.yml
@@ -24,7 +24,7 @@ pkg.keywords:
pkg.deps:
- hw/hal
- - libs/testutil
+ - test/testutil
pkg.deps.SELFTEST:
- - libs/console/stub
+ - sys/console/stub
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/libs/util/test/pkg.yml
----------------------------------------------------------------------
diff --git a/libs/util/test/pkg.yml b/libs/util/test/pkg.yml
deleted file mode 100644
index 3a8cf98..0000000
--- a/libs/util/test/pkg.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-pkg.name: libs/util/test
-pkg.type: unittest
-pkg.description: "Util unit tests."
-pkg.author: "Apache Mynewt <de...@mynewt.incubator.apache.org>"
-pkg.homepage: "http://mynewt.apache.org/"
-pkg.keywords:
-
-pkg.deps:
- - libs/testutil
- - libs/util
-
-pkg.deps.SELFTEST:
- - libs/console/stub
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/libs/util/test/src/hex_test.c
----------------------------------------------------------------------
diff --git a/libs/util/test/src/hex_test.c b/libs/util/test/src/hex_test.c
deleted file mode 100644
index 8183425..0000000
--- a/libs/util/test/src/hex_test.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#include <stdio.h>
-#include <string.h>
-
-#include "testutil/testutil.h"
-#include "util/hex.h"
-
-TEST_CASE(hex2str)
-{
- int i;
- char *ret;
- char cmp_data[8];
-
- struct {
- char *in;
- int inlen;
- char *out;
- int outlen;
- } test_data[] = {
- [0] = {
- .in = "\x01",
- .inlen = 1,
- .out = "01",
- .outlen = 2,
- },
- [1] = {
- .in = "\xaf\xf2",
- .inlen = 2,
- .out = "aff2",
- .outlen = 4,
- }
- };
-
- for (i = 0; i < sizeof(test_data) / sizeof(test_data[0]); i++) {
- ret = hex_format(test_data[i].in, test_data[i].inlen,
- cmp_data, sizeof(cmp_data));
- TEST_ASSERT(ret == cmp_data);
- TEST_ASSERT(strlen(cmp_data) == test_data[i].outlen);
- TEST_ASSERT(!strcmp(test_data[i].out, cmp_data));
- }
-
- /*
- * Test not enough space. Must have space for '\0' at the end.
- */
- ret = hex_format("\x01\x02", 2, cmp_data, 1);
- TEST_ASSERT(ret == NULL);
-
- ret = hex_format("\x01\x02", 2, cmp_data, 2);
- TEST_ASSERT(ret == NULL);
-}
-
-TEST_CASE(str2hex)
-{
- int i;
- char cmp_data[8];
- int rc;
-
- struct {
- char *in;
- int inlen;
- char *out;
- int outlen;
- } test_data[] = {
- [0] = {
- .in = "01",
- .inlen = 2,
- .out = "\x01",
- .outlen = 1,
- },
- [1] = {
- .in = "AfF2",
- .inlen = 4,
- .out = "\xaf\xf2",
- .outlen = 2,
- }
- };
-
- for (i = 0; i < sizeof(test_data) / sizeof(test_data[0]); i++) {
- rc = hex_parse(test_data[i].in, test_data[i].inlen,
- cmp_data, sizeof(cmp_data));
- TEST_ASSERT(rc == test_data[i].outlen);
- TEST_ASSERT(!memcmp(test_data[i].out, cmp_data, rc));
- }
-
- /*
- * Test invalid input
- */
- rc = hex_parse("HJ", 2, cmp_data, sizeof(cmp_data));
- TEST_ASSERT(rc < 0);
-
- rc = hex_parse("a", 1, cmp_data, sizeof(cmp_data));
- TEST_ASSERT(rc < 0);
-
- rc = hex_parse("0102", 4, cmp_data, 1);
- TEST_ASSERT(rc < 0);
-
- /*
- * This should be valid.
- */
- rc = hex_parse("0102", 4, cmp_data, 2);
- TEST_ASSERT(rc == 2);
-}
-
-TEST_SUITE(hex_fmt_test_suite)
-{
- hex2str();
- str2hex();
-}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/libs/util/test/src/util_test.c
----------------------------------------------------------------------
diff --git a/libs/util/test/src/util_test.c b/libs/util/test/src/util_test.c
deleted file mode 100644
index 4e21a9a..0000000
--- a/libs/util/test/src/util_test.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <stddef.h>
-#include "syscfg/syscfg.h"
-#include "testutil/testutil.h"
-#include "util_test_priv.h"
-
-int
-util_test_all(void)
-{
- cbmem_test_suite();
- return tu_case_failed;
-}
-
-int
-hex_fmt_test_all(void)
-{
- hex_fmt_test_suite();
- return tu_case_failed;
-}
-
-#if MYNEWT_VAL(SELFTEST)
-
-int
-main(int argc, char **argv)
-{
- tu_config.tc_print_results = 1;
- tu_init();
-
- util_test_all();
- hex_fmt_test_all();
- return tu_any_failed;
-}
-
-#endif
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/libs/util/test/src/util_test_priv.h
----------------------------------------------------------------------
diff --git a/libs/util/test/src/util_test_priv.h b/libs/util/test/src/util_test_priv.h
deleted file mode 100644
index c82df29..0000000
--- a/libs/util/test/src/util_test_priv.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef __UTIL_TEST_PRIV_
-#define __UTIL_TEST_PRIV_
-
-int cbmem_test_suite(void);
-int hex_fmt_test_suite(void);
-
-#endif
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/net/ip/mn_socket/test/pkg.yml
----------------------------------------------------------------------
diff --git a/net/ip/mn_socket/test/pkg.yml b/net/ip/mn_socket/test/pkg.yml
index b46d24c..25c4d0a 100644
--- a/net/ip/mn_socket/test/pkg.yml
+++ b/net/ip/mn_socket/test/pkg.yml
@@ -23,8 +23,8 @@ pkg.homepage: "http://mynewt.apache.org/"
pkg.keywords:
pkg.deps:
- - libs/testutil
- - sys/mn_socket
+ - test/testutil
+ - net/ip/mn_socket
pkg.deps.SELFTEST:
- - libs/console/stub
+ - sys/console/stub
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/net/nimble/host/test/pkg.yml
----------------------------------------------------------------------
diff --git a/net/nimble/host/test/pkg.yml b/net/nimble/host/test/pkg.yml
index ce5ed4e..e2ba7d2 100644
--- a/net/nimble/host/test/pkg.yml
+++ b/net/nimble/host/test/pkg.yml
@@ -23,11 +23,11 @@ pkg.homepage: "http://mynewt.apache.org/"
pkg.keywords:
pkg.deps:
- - libs/testutil
+ - test/testutil
- net/nimble/host
pkg.deps.SELFTEST:
- - libs/console/stub
+ - sys/console/stub
- net/nimble/transport/ram
pkg.syscfg_vals.SELFTEST:
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/sys/config/pkg.yml
----------------------------------------------------------------------
diff --git a/sys/config/pkg.yml b/sys/config/pkg.yml
index 4b4b6ff..a4d4ca2 100644
--- a/sys/config/pkg.yml
+++ b/sys/config/pkg.yml
@@ -25,6 +25,7 @@ pkg.keywords:
pkg.deps:
- libs/util
+ - encoding/base64
pkg.deps.CONFIG_CLI:
- sys/shell
pkg.deps.CONFIG_NEWTMGR:
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/sys/config/test/pkg.yml
----------------------------------------------------------------------
diff --git a/sys/config/test/pkg.yml b/sys/config/test/pkg.yml
index 0a366db..7a8539f 100644
--- a/sys/config/test/pkg.yml
+++ b/sys/config/test/pkg.yml
@@ -23,13 +23,13 @@ pkg.homepage: "http://mynewt.apache.org/"
pkg.keywords:
pkg.deps:
- - libs/testutil
+ - test/testutil
- sys/config
pkg.deps.SELFTEST:
- fs/nffs
- - sys/fcb
- - libs/console/stub
+ - fs/fcb
+ - sys/console/stub
pkg.syscfg_vals.SELFTEST:
CONFIG_NFFS: 1
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/sys/log/test/pkg.yml
----------------------------------------------------------------------
diff --git a/sys/log/test/pkg.yml b/sys/log/test/pkg.yml
index f3d094a..f50b733 100644
--- a/sys/log/test/pkg.yml
+++ b/sys/log/test/pkg.yml
@@ -23,11 +23,11 @@ pkg.homepage: "http://mynewt.apache.org/"
pkg.keywords:
pkg.deps:
- - libs/testutil
+ - test/testutil
- sys/log
pkg.deps.SELFTEST:
- - libs/console/stub
+ - sys/console/stub
pkg.syscfg_vals:
LOG_FCB: 1
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/util/cbmem/test/src/util_test.c
----------------------------------------------------------------------
diff --git a/util/cbmem/test/src/util_test.c b/util/cbmem/test/src/util_test.c
index 4e21a9a..d34f6c9 100644
--- a/util/cbmem/test/src/util_test.c
+++ b/util/cbmem/test/src/util_test.c
@@ -6,7 +6,7 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
@@ -30,13 +30,6 @@ util_test_all(void)
return tu_case_failed;
}
-int
-hex_fmt_test_all(void)
-{
- hex_fmt_test_suite();
- return tu_case_failed;
-}
-
#if MYNEWT_VAL(SELFTEST)
int
@@ -46,7 +39,6 @@ main(int argc, char **argv)
tu_init();
util_test_all();
- hex_fmt_test_all();
return tu_any_failed;
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/util/crc/test/pkg.yml
----------------------------------------------------------------------
diff --git a/util/crc/test/pkg.yml b/util/crc/test/pkg.yml
deleted file mode 100644
index dac3cb1..0000000
--- a/util/crc/test/pkg.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-pkg.name: crypto/encoding/test
-pkg.type: unittest
-pkg.description: "Crypto encoding unit tests."
-pkg.author: "Apache Mynewt <de...@mynewt.incubator.apache.org>"
-pkg.homepage: "http://mynewt.apache.org/"
-pkg.keywords:
-
-pkg.deps:
- - libs/testutil
- - libs/util
-
-pkg.deps.SELFTEST:
- - libs/console/stub
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/util/crc/test/src/encoding_test.c
----------------------------------------------------------------------
diff --git a/util/crc/test/src/encoding_test.c b/util/crc/test/src/encoding_test.c
deleted file mode 100644
index b21fee8..0000000
--- a/util/crc/test/src/encoding_test.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <stddef.h>
-#include "syscfg/syscfg.h"
-#include "testutil/testutil.h"
-#include "encoding_test_priv.h"
-
-
-int
-hex_fmt_test_all(void)
-{
- hex_fmt_test_suite();
- return tu_case_failed;
-}
-
-#if MYNEWT_VAL(SELFTEST)
-
-int
-main(int argc, char **argv)
-{
- tu_config.tc_print_results = 1;
- tu_init();
-
- hex_fmt_test_all();
- return tu_any_failed;
-}
-
-#endif
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/util/crc/test/src/encoding_test_priv.h
----------------------------------------------------------------------
diff --git a/util/crc/test/src/encoding_test_priv.h b/util/crc/test/src/encoding_test_priv.h
deleted file mode 100644
index fc2fcac..0000000
--- a/util/crc/test/src/encoding_test_priv.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef __ENCODING_TEST_PRIV_
-#define __ENCODING_TEST_PRIV_
-
-int hex_fmt_test_suite(void);
-
-#endif
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/040aa6f2/util/crc/test/src/hex_test.c
----------------------------------------------------------------------
diff --git a/util/crc/test/src/hex_test.c b/util/crc/test/src/hex_test.c
deleted file mode 100644
index 8183425..0000000
--- a/util/crc/test/src/hex_test.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#include <stdio.h>
-#include <string.h>
-
-#include "testutil/testutil.h"
-#include "util/hex.h"
-
-TEST_CASE(hex2str)
-{
- int i;
- char *ret;
- char cmp_data[8];
-
- struct {
- char *in;
- int inlen;
- char *out;
- int outlen;
- } test_data[] = {
- [0] = {
- .in = "\x01",
- .inlen = 1,
- .out = "01",
- .outlen = 2,
- },
- [1] = {
- .in = "\xaf\xf2",
- .inlen = 2,
- .out = "aff2",
- .outlen = 4,
- }
- };
-
- for (i = 0; i < sizeof(test_data) / sizeof(test_data[0]); i++) {
- ret = hex_format(test_data[i].in, test_data[i].inlen,
- cmp_data, sizeof(cmp_data));
- TEST_ASSERT(ret == cmp_data);
- TEST_ASSERT(strlen(cmp_data) == test_data[i].outlen);
- TEST_ASSERT(!strcmp(test_data[i].out, cmp_data));
- }
-
- /*
- * Test not enough space. Must have space for '\0' at the end.
- */
- ret = hex_format("\x01\x02", 2, cmp_data, 1);
- TEST_ASSERT(ret == NULL);
-
- ret = hex_format("\x01\x02", 2, cmp_data, 2);
- TEST_ASSERT(ret == NULL);
-}
-
-TEST_CASE(str2hex)
-{
- int i;
- char cmp_data[8];
- int rc;
-
- struct {
- char *in;
- int inlen;
- char *out;
- int outlen;
- } test_data[] = {
- [0] = {
- .in = "01",
- .inlen = 2,
- .out = "\x01",
- .outlen = 1,
- },
- [1] = {
- .in = "AfF2",
- .inlen = 4,
- .out = "\xaf\xf2",
- .outlen = 2,
- }
- };
-
- for (i = 0; i < sizeof(test_data) / sizeof(test_data[0]); i++) {
- rc = hex_parse(test_data[i].in, test_data[i].inlen,
- cmp_data, sizeof(cmp_data));
- TEST_ASSERT(rc == test_data[i].outlen);
- TEST_ASSERT(!memcmp(test_data[i].out, cmp_data, rc));
- }
-
- /*
- * Test invalid input
- */
- rc = hex_parse("HJ", 2, cmp_data, sizeof(cmp_data));
- TEST_ASSERT(rc < 0);
-
- rc = hex_parse("a", 1, cmp_data, sizeof(cmp_data));
- TEST_ASSERT(rc < 0);
-
- rc = hex_parse("0102", 4, cmp_data, 1);
- TEST_ASSERT(rc < 0);
-
- /*
- * This should be valid.
- */
- rc = hex_parse("0102", 4, cmp_data, 2);
- TEST_ASSERT(rc == 2);
-}
-
-TEST_SUITE(hex_fmt_test_suite)
-{
- hex2str();
- str2hex();
-}