Skip to content

Commit ddce678

Browse files
committed
sys/log/full/selftest: Add selftests for num_entries
1 parent 73d13af commit ddce678

File tree

10 files changed

+318
-0
lines changed

10 files changed

+318
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
pkg.name: sys/log/full/selftest/align1_img_hash_num_entries
19+
pkg.type: unittest
20+
pkg.description: "Log unit tests; flash-alignment=1."
21+
pkg.author: "Apache Mynewt <[email protected]>"
22+
pkg.homepage: "http://mynewt.apache.org/"
23+
pkg.keywords:
24+
25+
pkg.deps:
26+
- "@apache-mynewt-core/sys/console/stub"
27+
- "@apache-mynewt-core/sys/log/full"
28+
- "@apache-mynewt-core/sys/log/full/selftest/util"
29+
- "@apache-mynewt-core/test/testutil"
30+
- "@apache-mynewt-core/boot/stub"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
#include "os/mynewt.h"
21+
#include "log_test_util/log_test_util.h"
22+
23+
int
24+
main(int argc, char **argv)
25+
{
26+
log_test_suite_cbmem_flat();
27+
log_test_suite_cbmem_mbuf();
28+
log_test_suite_fcb_flat();
29+
log_test_suite_fcb_mbuf();
30+
log_test_suite_misc();
31+
32+
return tu_any_failed;
33+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
19+
syscfg.vals:
20+
LOG_FCB: 1
21+
MCU_FLASH_MIN_WRITE_SIZE: 1
22+
23+
# The mbuf append tests allocate lots of mbufs; ensure no exhaustion.
24+
MSYS_1_BLOCK_COUNT: 1000
25+
LOG_FLAGS_IMAGE_HASH: 1
26+
LOG_FLAGS_TLV_SUPPORT: 1
27+
LOG_TLV_NUM_ENTRIES: 1
28+
IMGMGR_DUMMY_HDR: 1
29+
LOG_MGMT: 0
30+
IMG_MGMT: 0
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
pkg.name: sys/log/full/selftest/align1_num_entries
19+
pkg.type: unittest
20+
pkg.description: "Log unit tests; flash-alignment=1."
21+
pkg.author: "Apache Mynewt <[email protected]>"
22+
pkg.homepage: "http://mynewt.apache.org/"
23+
pkg.keywords:
24+
25+
pkg.deps:
26+
- "@apache-mynewt-core/sys/console/stub"
27+
- "@apache-mynewt-core/sys/log/full"
28+
- "@apache-mynewt-core/sys/log/full/selftest/util"
29+
- "@apache-mynewt-core/test/testutil"
30+
- "@apache-mynewt-core/boot/stub"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
#include "os/mynewt.h"
21+
#include "log_test_util/log_test_util.h"
22+
23+
int
24+
main(int argc, char **argv)
25+
{
26+
log_test_suite_cbmem_flat();
27+
log_test_suite_cbmem_mbuf();
28+
log_test_suite_fcb_flat();
29+
log_test_suite_fcb_mbuf();
30+
log_test_suite_misc();
31+
32+
return tu_any_failed;
33+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
19+
syscfg.vals:
20+
LOG_FCB: 1
21+
MCU_FLASH_MIN_WRITE_SIZE: 1
22+
23+
# The mbuf append tests allocate lots of mbufs; ensure no exhaustion.
24+
MSYS_1_BLOCK_COUNT: 1000
25+
LOG_FLAGS_TLV_SUPPORT: 1
26+
LOG_TLV_NUM_ENTRIES: 1
27+
IMGMGR_DUMMY_HDR: 1
28+
LOG_MGMT: 0
29+
IMG_MGMT: 0
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
pkg.name: sys/log/full/selftest/align4_num_entries
19+
pkg.type: unittest
20+
pkg.description: "Log unit tests; flash-alignment=4."
21+
pkg.author: "Apache Mynewt <[email protected]>"
22+
pkg.homepage: "http://mynewt.apache.org/"
23+
pkg.keywords:
24+
25+
pkg.deps:
26+
- "@apache-mynewt-core/sys/console/stub"
27+
- "@apache-mynewt-core/sys/log/full"
28+
- "@apache-mynewt-core/sys/log/full/selftest/util"
29+
- "@apache-mynewt-core/test/testutil"
30+
- "@apache-mynewt-core/boot/stub"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
#include "os/mynewt.h"
21+
#include "log_test_util/log_test_util.h"
22+
23+
int
24+
main(int argc, char **argv)
25+
{
26+
log_test_suite_cbmem_flat();
27+
log_test_suite_cbmem_mbuf();
28+
log_test_suite_fcb_flat();
29+
log_test_suite_fcb_mbuf();
30+
log_test_suite_misc();
31+
32+
return tu_any_failed;
33+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
#include "os/mynewt.h"
21+
#include "log_test_util/log_test_util.h"
22+
23+
int
24+
main(int argc, char **argv)
25+
{
26+
log_test_suite_cbmem_flat();
27+
28+
log_test_suite_cbmem_mbuf();
29+
log_test_suite_fcb_flat();
30+
31+
#if 0
32+
/* Current fcb mbuf implementation supports only
33+
* 1 byte alignment
34+
*/
35+
log_test_suite_fcb_mbuf();
36+
#endif
37+
38+
log_test_suite_misc();
39+
40+
return tu_any_failed;
41+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
19+
syscfg.vals:
20+
LOG_FCB: 1
21+
MCU_FLASH_MIN_WRITE_SIZE: 1
22+
23+
# The mbuf append tests allocate lots of mbufs; ensure no exhaustion.
24+
MSYS_1_BLOCK_COUNT: 1000
25+
LOG_FLAGS_TLV_SUPPORT: 1
26+
LOG_TLV_NUM_ENTRIES: 1
27+
IMGMGR_DUMMY_HDR: 1
28+
LOG_MGMT: 0
29+
IMG_MGMT: 0

0 commit comments

Comments
 (0)