Added code quality and standardization profile (for use with Vera++). Increased maximum number of lwIP UDP_PCBs from 4 to 128

This commit is contained in:
Joseph Henry
2017-09-12 16:34:13 -07:00
parent 5512ede4fd
commit ca84110a16
3 changed files with 90 additions and 1 deletions

4
FAQ.md
View File

@@ -17,6 +17,10 @@ In order of relevance, enable the following: For `libzt`-specific debug output w
Each version of libzt will include a specific (and unrelated) version of the ZeroTier core, and network stacks. For instance: Version 1.1.5 of libzt might include version 1.2.5 of ZeroTier, there is no connection between these versioning schemes. Additionally, an update to libzt doesn't necessarily translate to an update to the ZeroTier core.
### Code Quality and Standardization
Explicit coding style rules are specified in `test/vera++/libzt` and enforced periodically by running the source through `vera++`. Before each commit or merge into `master` one should run `test/selftest` and `test/nativetest` as specified in [TESTING.md](TESTING.md). Also, on the tabs vs. spaces debate, for this project we have chosen `tabs`.
### How do I run unit tests?
See: [TESTING.md](TESTING.md)

View File

@@ -273,7 +273,7 @@ happening sooner than they should.
* per active UDP "connection".
* (requires the LWIP_UDP option)
*/
#define MEMP_NUM_UDP_PCB 4
#define MEMP_NUM_UDP_PCB 128
/**
* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.

85
test/vera++/libzt Normal file
View File

@@ -0,0 +1,85 @@
# Source files should not use the 'r' (CR) character
rule=F001
# File names should be well-formed
rule=F002
# No trailing whitespace
rule=L001
parameter=strict-trailing-space=0
# Don't use tab characters
# project deliberately uses TABS, so this rule should be left commented out
# rule=L002
# No leading and no trailing empty lines
rule=L003
# Line cannot be too long
rule=L004
parameter=max-line-length=120
# There should not be too many consecutive empty lines
rule=L005
parameter=max-consecutive-empty-lines=5
# Source file should not be too long
# rule=L006
# parameter=max-file-length=3000
# One-line comments should not have forced continuation
rule=T001
# Reserved names should not be used for preprocessor macros
rule=T002
# Some keywords should be followed by a single space
rule=T003
# Some keywords should be immediately followed by a colon
rule=T004
# Keywords break and continue should be immediately followed by a semicolon
rule=T005
# Keywords return and throw should be immediately followed by a semicolon or a single space
rule=T006
# Semicolons should not be isolated by spaces or comments from
rule=T007
# Keywords catch, for, if, switch and while should be followed by a single space
rule=T008
# Comma should not be preceded by whitespace, but should be followed by one
rule=T009
# Identifiers should not be composed of 'l' and 'O' characters only
rule=T010
# Curly brackets from the same pair should be either in the same line or in the same column
# rule=T011
# Negation operator should not be used in its short form
rule=T012
# Source files should contain the copyright notice
rule=T013
#
# rule=T014
# HTML links in comments and string literals should be correct
rule=T015
# Calls to min/max should be protected against accidental macro
rule=T016
# Unnamed namespaces are not allowed in header files
rule=T017
# Using namespace is not allowed in header files
rule=T018
# Control structures should have complete curly-braced block of code
rule=T019