Skip to content

Commit 1aa84a3

Browse files
author
Seppo Takalo
committed
Fix Astyle failures
1 parent f6c08b3 commit 1aa84a3

File tree

7 files changed

+41
-39
lines changed

7 files changed

+41
-39
lines changed

.astyleignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@
3131
^TESTS/mbed_hal/trng/pithy
3232
^TESTS/mbed_hal/trng/pithy
3333
^tools
34+
^UNITTESTS

UNITTESTS/features/storage/blockdevice/HeapBlockDevice/test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ TEST_F(HeapBlockDeviceTest, get_type)
5151

5252
TEST_F(HeapBlockDeviceTest, erase_program_read)
5353
{
54-
uint8_t *block = new uint8_t[BLOCK_SIZE]{0xaa,0xbb,0xcc};
54+
uint8_t *block = new uint8_t[BLOCK_SIZE] {0xaa,0xbb,0xcc};
5555
uint8_t *buf = new uint8_t[BLOCK_SIZE];
5656
EXPECT_EQ(bd.erase(0, BLOCK_SIZE), BD_ERROR_OK);
5757
EXPECT_EQ(bd.program(block, 0, BLOCK_SIZE), BD_ERROR_OK);
@@ -79,7 +79,7 @@ TEST_F(HeapBlockDeviceTest, over_read)
7979

8080
TEST_F(HeapBlockDeviceTest, over_write)
8181
{
82-
uint8_t *buf = new uint8_t[BLOCK_SIZE]{0xaa,0xbb,0xcc};
82+
uint8_t *buf = new uint8_t[BLOCK_SIZE] {0xaa,0xbb,0xcc};
8383
EXPECT_EQ(bd.program(buf, DEVICE_SIZE, BLOCK_SIZE), BD_ERROR_DEVICE_ERROR);
8484
delete[] buf;
8585
}

UNITTESTS/moduletests/storage/blockdevice/SlicingBlockDevice/moduletest.cpp

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class VerifyBorders_HeapBlockDevice : public mbed::HeapBlockDevice {
1212
mutable bd_size_t upper_limit;
1313

1414
VerifyBorders_HeapBlockDevice(bd_size_t size)
15-
: HeapBlockDevice(size) {
15+
: HeapBlockDevice(size)
16+
{
1617
borders_crossed = false;
1718
lower_limit = 0;
1819
upper_limit = size;
@@ -21,21 +22,21 @@ class VerifyBorders_HeapBlockDevice : public mbed::HeapBlockDevice {
2122
virtual bool is_valid_read(bd_addr_t addr, bd_size_t size) const
2223
{
2324
borders_crossed |= addr < lower_limit;
24-
borders_crossed |= addr+size > upper_limit;
25+
borders_crossed |= addr + size > upper_limit;
2526
return BlockDevice::is_valid_read(addr, size);
2627
}
2728

2829
virtual bool is_valid_program(bd_addr_t addr, bd_size_t size) const
2930
{
3031
borders_crossed |= addr < lower_limit;
31-
borders_crossed |= addr+size > upper_limit;
32+
borders_crossed |= addr + size > upper_limit;
3233
return BlockDevice::is_valid_program(addr, size);
3334
}
3435

3536
virtual bool is_valid_erase(bd_addr_t addr, bd_size_t size) const
3637
{
3738
borders_crossed |= addr < lower_limit;
38-
borders_crossed |= addr+size > upper_limit;
39+
borders_crossed |= addr + size > upper_limit;
3940
return BlockDevice::is_valid_erase(addr, size);
4041
}
4142
};
@@ -51,7 +52,7 @@ class SlicingBlockModuleTest : public testing::Test {
5152
magic = new uint8_t[BLOCK_SIZE];
5253
buf = new uint8_t[BLOCK_SIZE];
5354
// Generate simple pattern to verify against
54-
for (int i=0; i < BLOCK_SIZE; i++) {
55+
for (int i = 0; i < BLOCK_SIZE; i++) {
5556
magic[i] = 0xaa + i;
5657
}
5758
}
@@ -77,20 +78,20 @@ TEST_F(SlicingBlockModuleTest, constructor)
7778

7879
TEST_F(SlicingBlockModuleTest, slice_in_middle)
7980
{
80-
uint8_t *program = new uint8_t[BLOCK_SIZE]{0xbb,0xbb,0xbb};
81+
uint8_t *program = new uint8_t[BLOCK_SIZE] {0xbb,0xbb,0xbb};
8182

8283
//Write magic value to heap block before and after the space for slice
8384
bd.program(magic, 0, BLOCK_SIZE);
84-
bd.program(magic, BLOCK_SIZE*3, BLOCK_SIZE);
85+
bd.program(magic, BLOCK_SIZE * 3, BLOCK_SIZE);
8586

86-
bd.upper_limit = BLOCK_SIZE*3;
87+
bd.upper_limit = BLOCK_SIZE * 3;
8788
bd.lower_limit = BLOCK_SIZE;
8889
bd.borders_crossed = false;
8990

9091
//Skip first block, then create sclicing device, with size of 2 blocks
91-
mbed::SlicingBlockDevice slice(&bd, BLOCK_SIZE, BLOCK_SIZE*3);
92+
mbed::SlicingBlockDevice slice(&bd, BLOCK_SIZE, BLOCK_SIZE * 3);
9293
EXPECT_EQ(slice.init(), BD_ERROR_OK);
93-
EXPECT_EQ(BLOCK_SIZE*2, slice.size());
94+
EXPECT_EQ(BLOCK_SIZE * 2, slice.size());
9495
EXPECT_EQ(bd.borders_crossed, false);
9596

9697
//Program a test value
@@ -101,44 +102,44 @@ TEST_F(SlicingBlockModuleTest, slice_in_middle)
101102
//Verify that blocks before and after the slicing blocks are not touched
102103
bd.read(buf, 0, BLOCK_SIZE);
103104
EXPECT_EQ(0, memcmp(buf, magic, BLOCK_SIZE));
104-
bd.read(buf, BLOCK_SIZE*3, BLOCK_SIZE);
105+
bd.read(buf, BLOCK_SIZE * 3, BLOCK_SIZE);
105106
EXPECT_EQ(0, memcmp(buf, magic, BLOCK_SIZE));
106107
}
107108

108109
TEST_F(SlicingBlockModuleTest, slice_at_the_end)
109110
{
110-
uint8_t *program = new uint8_t[BLOCK_SIZE]{0xbb,0xbb,0xbb};
111+
uint8_t *program = new uint8_t[BLOCK_SIZE] {0xbb,0xbb,0xbb};
111112

112113
//Write magic value to heap block before the space for slice
113114
// our bd is 10*BLOCK_SIZE, so sector 7
114-
bd.program(magic, BLOCK_SIZE*7, BLOCK_SIZE);
115+
bd.program(magic, BLOCK_SIZE * 7, BLOCK_SIZE);
115116

116117
//Screate sclicing device, with size of 2 blocks
117118
// Use negative index
118119
mbed::SlicingBlockDevice slice(&bd, -BLOCK_SIZE*2);
119120
EXPECT_EQ(slice.init(), BD_ERROR_OK);
120-
EXPECT_EQ(BLOCK_SIZE*2, slice.size());
121+
EXPECT_EQ(BLOCK_SIZE * 2, slice.size());
121122

122123
//Program a test value
123124
EXPECT_EQ(slice.program(program, 0, BLOCK_SIZE), BD_ERROR_OK);
124125
EXPECT_EQ(slice.program(program, BLOCK_SIZE, BLOCK_SIZE), BD_ERROR_OK);
125126

126127
//Verify that blocks before and after the slicing blocks are not touched
127-
bd.read(buf, BLOCK_SIZE*7, BLOCK_SIZE);
128+
bd.read(buf, BLOCK_SIZE * 7, BLOCK_SIZE);
128129
EXPECT_EQ(0, memcmp(buf, magic, BLOCK_SIZE));
129130
}
130131

131132
TEST_F(SlicingBlockModuleTest, over_write)
132133
{
133-
uint8_t *program = new uint8_t[BLOCK_SIZE]{0xbb,0xbb,0xbb};
134+
uint8_t *program = new uint8_t[BLOCK_SIZE] {0xbb,0xbb,0xbb};
134135

135136
//Screate sclicing device, with size of 2 blocks
136-
mbed::SlicingBlockDevice slice(&bd, BLOCK_SIZE, BLOCK_SIZE*3);
137+
mbed::SlicingBlockDevice slice(&bd, BLOCK_SIZE, BLOCK_SIZE * 3);
137138
EXPECT_EQ(slice.init(), BD_ERROR_OK);
138139

139140
EXPECT_EQ(slice.program(program, 0, BLOCK_SIZE), BD_ERROR_OK);
140141
EXPECT_EQ(slice.program(program, BLOCK_SIZE, BLOCK_SIZE), BD_ERROR_OK);
141142
//Program a test value to address that is one pass the device size
142-
EXPECT_EQ(slice.program(program, 2*BLOCK_SIZE, BLOCK_SIZE), BD_ERROR_DEVICE_ERROR);
143+
EXPECT_EQ(slice.program(program, 2 * BLOCK_SIZE, BLOCK_SIZE), BD_ERROR_DEVICE_ERROR);
143144

144145
}

UNITTESTS/stubs/mbed_atomic_stub.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,33 +57,33 @@ uint32_t core_util_atomic_exchange_u32(volatile uint32_t *ptr, uint32_t desiredV
5757

5858
uint8_t core_util_atomic_incr_u8(volatile uint8_t *valuePtr, uint8_t delta)
5959
{
60-
return *valuePtr+=delta;
60+
return *valuePtr += delta;
6161
}
6262

6363
uint16_t core_util_atomic_incr_u16(volatile uint16_t *valuePtr, uint16_t delta)
6464
{
65-
return *valuePtr+=delta;
65+
return *valuePtr += delta;
6666
}
6767

6868
uint32_t core_util_atomic_incr_u32(volatile uint32_t *valuePtr, uint32_t delta)
6969
{
70-
return *valuePtr+=delta;
70+
return *valuePtr += delta;
7171
}
7272

7373

7474
uint8_t core_util_atomic_decr_u8(volatile uint8_t *valuePtr, uint8_t delta)
7575
{
76-
return *valuePtr-=delta;
76+
return *valuePtr -= delta;
7777
}
7878

7979
uint16_t core_util_atomic_decr_u16(volatile uint16_t *valuePtr, uint16_t delta)
8080
{
81-
return *valuePtr-=delta;
81+
return *valuePtr -= delta;
8282
}
8383

8484
uint32_t core_util_atomic_decr_u32(volatile uint32_t *valuePtr, uint32_t delta)
8585
{
86-
return *valuePtr-=delta;
86+
return *valuePtr -= delta;
8787
}
8888

8989

UNITTESTS/target_h/PinNames.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ typedef enum {
3434
} PinName;
3535

3636
typedef enum {
37-
PullNone,
38-
PullUp,
39-
PullDown
37+
PullNone,
38+
PullUp,
39+
PullDown
4040
} PinMode;
4141

4242
typedef enum {

UNITTESTS/target_h/gpio_object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" {
2727
#endif
2828

2929
typedef struct {
30-
int unused;
30+
int unused;
3131
} gpio_t;
3232

3333
#ifdef __cplusplus

UNITTESTS/target_h/objects.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,39 +34,39 @@ struct serial_s {
3434
};
3535

3636
struct dac_s {
37-
int unused;
37+
int unused;
3838
};
3939

4040
struct i2c_s {
41-
int unused;
41+
int unused;
4242
};
4343

4444
struct qspi_s {
45-
int unused;
45+
int unused;
4646
};
4747

4848
struct spi_s {
49-
int unused;
49+
int unused;
5050
};
5151

5252
struct analogin_s {
53-
int unused;
53+
int unused;
5454
};
5555

5656
struct port_s {
57-
int unused;
57+
int unused;
5858
};
5959

6060
struct pwmout_s {
61-
int unused;
61+
int unused;
6262
};
6363

6464
struct flash_s {
65-
int unused;
65+
int unused;
6666
};
6767

6868
struct can_s {
69-
int unused;
69+
int unused;
7070
};
7171

7272
#include "gpio_object.h"

0 commit comments

Comments
 (0)