Skip to content

Commit 7de306d

Browse files
committed
Format test suites
1 parent 0ec3fd6 commit 7de306d

File tree

2 files changed

+12
-12
lines changed
  • c
    • cert/test/rules/INT34-C
    • misra/test/rules/RULE-7-4

2 files changed

+12
-12
lines changed

c/cert/test/rules/INT34-C/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <limits.h>
33
#include <stddef.h>
44

5-
extern size_t popcount(uintmax_t) {};
5+
extern size_t popcount(uintmax_t){};
66
#define PRECISION(x) popcount(x)
77

88
int main() {

c/misra/test/rules/RULE-7-4/test.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include <wchar.h>
21
#include <stdio.h>
2+
#include <wchar.h>
33

44
void sample1() {
55
/* Test for plain char type */
@@ -16,15 +16,15 @@ void sample1() {
1616

1717
/* Test for wide char type */
1818
const wchar_t *ws1 = L"wide string1"; // COMPLIANT: string literal assigned to
19-
// a const char* variable
19+
// a const char* variable
2020
const register volatile wchar_t *ws2 =
2121
L"wide string2"; // COMPLIANT: string literal assigned to a const char*
22-
// variable, don't care about the qualifiers
23-
wchar_t *ws3 = L"wide string3"; // NON_COMPLIANT: char* variable declared to hold
24-
// a string literal
25-
ws3 = L"wide string4"; // NON_COMPLIANT: char* variable assigned a string
26-
// literal (not likely to be seen in production, since
27-
// there is strcpy)
22+
// variable, don't care about the qualifiers
23+
wchar_t *ws3 = L"wide string3"; // NON_COMPLIANT: char* variable declared to
24+
// hold a string literal
25+
ws3 = L"wide string4"; // NON_COMPLIANT: char* variable assigned a string
26+
// literal (not likely to be seen in production, since
27+
// there is strcpy)
2828
}
2929

3030
/* Testing returning a plain string literal */
@@ -39,8 +39,8 @@ const char *sample2(int x) {
3939
/* Testing returning a wide string literal */
4040
const wchar_t *w_sample2(int x) {
4141
if (x == 1)
42-
return L"string5"; // COMPLIANT: can return a string literal with return type
43-
// being const char* being const char*
42+
return L"string5"; // COMPLIANT: can return a string literal with return
43+
// type being const char* being const char*
4444
else
4545
return NULL;
4646
}
@@ -56,7 +56,7 @@ char *sample3(int x) {
5656
wchar_t *w_sample3(int x) {
5757
if (x == 1)
5858
return L"string6"; // NON_COMPLIANT: can return a string literal with return
59-
// type being char*
59+
// type being char*
6060
else
6161
return NULL;
6262
}

0 commit comments

Comments
 (0)