Browse Source

slim libraries

master
noerw 1 year ago
parent
commit
aa97b4cdae
100 changed files with 0 additions and 9362 deletions
  1. 0
    7
      libraries/Lora_Serialization/test/.eslintrc.js
  2. 0
    37
      libraries/Lora_Serialization/test/LoraMessage.js
  3. 0
    18
      libraries/Lora_Serialization/test/Makefile
  4. 0
    39
      libraries/Lora_Serialization/test/base.js
  5. 0
    20
      libraries/Lora_Serialization/test/decoder/bitmap.js
  6. 0
    52
      libraries/Lora_Serialization/test/decoder/decode.js
  7. 0
    18
      libraries/Lora_Serialization/test/decoder/humidity.js
  8. 0
    18
      libraries/Lora_Serialization/test/decoder/latLng.js
  9. 0
    23
      libraries/Lora_Serialization/test/decoder/temperature.js
  10. 0
    18
      libraries/Lora_Serialization/test/decoder/uint16.js
  11. 0
    18
      libraries/Lora_Serialization/test/decoder/uint8.js
  12. 0
    18
      libraries/Lora_Serialization/test/decoder/unixtime.js
  13. 0
    19
      libraries/Lora_Serialization/test/encoder/bitmap.js
  14. 0
    48
      libraries/Lora_Serialization/test/encoder/encode.js
  15. 0
    17
      libraries/Lora_Serialization/test/encoder/humidity.js
  16. 0
    22
      libraries/Lora_Serialization/test/encoder/latLng.js
  17. 0
    24
      libraries/Lora_Serialization/test/encoder/temperature.js
  18. 0
    19
      libraries/Lora_Serialization/test/encoder/uint16.js
  19. 0
    19
      libraries/Lora_Serialization/test/encoder/uint8.js
  20. 0
    18
      libraries/Lora_Serialization/test/encoder/unixtime.js
  21. 0
    12
      libraries/Lora_Serialization/test/helpers.cpp
  22. 0
    11
      libraries/Lora_Serialization/test/lib/Catch/.gitattributes
  23. 0
    29
      libraries/Lora_Serialization/test/lib/Catch/.github/issue_template.md
  24. 0
    25
      libraries/Lora_Serialization/test/lib/Catch/.github/pull_request_template.md
  25. 0
    29
      libraries/Lora_Serialization/test/lib/Catch/.gitignore
  26. 0
    232
      libraries/Lora_Serialization/test/lib/Catch/.travis.yml
  27. 0
    271
      libraries/Lora_Serialization/test/lib/Catch/CMakeLists.txt
  28. 0
    23
      libraries/Lora_Serialization/test/lib/Catch/LICENSE_1_0.txt
  29. 0
    23
      libraries/Lora_Serialization/test/lib/Catch/README.md
  30. 0
    45
      libraries/Lora_Serialization/test/lib/Catch/appveyor.yml
  31. BIN
      libraries/Lora_Serialization/test/lib/Catch/catch-hand-icon.png
  32. BIN
      libraries/Lora_Serialization/test/lib/Catch/catch-icon-tiny.png
  33. BIN
      libraries/Lora_Serialization/test/lib/Catch/catch-logo-small.png
  34. 0
    23
      libraries/Lora_Serialization/test/lib/Catch/docs/Readme.md
  35. 0
    136
      libraries/Lora_Serialization/test/lib/Catch/docs/assertions.md
  36. 0
    95
      libraries/Lora_Serialization/test/lib/Catch/docs/build-systems.md
  37. 0
    277
      libraries/Lora_Serialization/test/lib/Catch/docs/command-line.md
  38. 0
    12
      libraries/Lora_Serialization/test/lib/Catch/docs/commercial-users.md
  39. 0
    100
      libraries/Lora_Serialization/test/lib/Catch/docs/configuration.md
  40. 0
    41
      libraries/Lora_Serialization/test/lib/Catch/docs/contributing.md
  41. 0
    99
      libraries/Lora_Serialization/test/lib/Catch/docs/limitations.md
  42. 0
    52
      libraries/Lora_Serialization/test/lib/Catch/docs/logging.md
  43. 0
    103
      libraries/Lora_Serialization/test/lib/Catch/docs/matchers.md
  44. 0
    59
      libraries/Lora_Serialization/test/lib/Catch/docs/opensource-users.md
  45. 0
    72
      libraries/Lora_Serialization/test/lib/Catch/docs/own-main.md
  46. 0
    150
      libraries/Lora_Serialization/test/lib/Catch/docs/release-notes.md
  47. 0
    64
      libraries/Lora_Serialization/test/lib/Catch/docs/slow-compiles.md
  48. 0
    88
      libraries/Lora_Serialization/test/lib/Catch/docs/test-cases-and-sections.md
  49. 0
    32
      libraries/Lora_Serialization/test/lib/Catch/docs/test-fixtures.md
  50. 0
    70
      libraries/Lora_Serialization/test/lib/Catch/docs/tostring.md
  51. 0
    249
      libraries/Lora_Serialization/test/lib/Catch/docs/tutorial.md
  52. 0
    46
      libraries/Lora_Serialization/test/lib/Catch/docs/why-catch.md
  53. 0
    237
      libraries/Lora_Serialization/test/lib/Catch/include/catch.hpp
  54. 0
    219
      libraries/Lora_Serialization/test/lib/Catch/include/catch_session.hpp
  55. 0
    14
      libraries/Lora_Serialization/test/lib/Catch/include/catch_with_main.hpp
  56. 0
    1051
      libraries/Lora_Serialization/test/lib/Catch/include/external/clara.h
  57. 0
    168
      libraries/Lora_Serialization/test/lib/Catch/include/external/tbc_text_format.h
  58. 0
    180
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_approx.hpp
  59. 0
    127
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_assertionresult.h
  60. 0
    99
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_assertionresult.hpp
  61. 0
    154
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_capture.hpp
  62. 0
    32
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_clara.h
  63. 0
    215
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_commandline.hpp
  64. 0
    146
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_common.h
  65. 0
    119
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_common.hpp
  66. 0
    313
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_compiler_capabilities.h
  67. 0
    158
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_config.hpp
  68. 0
    67
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_console_colour.hpp
  69. 0
    190
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_console_colour_impl.hpp
  70. 0
    50
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_context.h
  71. 0
    110
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_context_impl.hpp
  72. 0
    58
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_debugger.h
  73. 0
    127
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_debugger.hpp
  74. 0
    39
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_default_main.hpp
  75. 0
    219
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_evaluate.hpp
  76. 0
    73
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_exception_translator_registry.hpp
  77. 0
    174
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_expression_lhs.hpp
  78. 0
    200
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_fatal_condition.hpp
  79. 0
    190
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_generators.hpp
  80. 0
    86
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_generators_impl.hpp
  81. 0
    109
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_impl.hpp
  82. 0
    47
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_interfaces_capture.h
  83. 0
    70
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_interfaces_config.h
  84. 0
    76
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_interfaces_exception.h
  85. 0
    32
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_interfaces_generators.h
  86. 0
    47
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_interfaces_registry_hub.h
  87. 0
    275
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_interfaces_reporter.h
  88. 0
    20
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_interfaces_runner.h
  89. 0
    26
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_interfaces_tag_alias_registry.h
  90. 0
    40
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_interfaces_testcase.h
  91. 0
    60
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_legacy_reporter_adapter.h
  92. 0
    84
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_legacy_reporter_adapter.hpp
  93. 0
    179
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_list.hpp
  94. 0
    168
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_matchers.hpp
  95. 0
    67
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_matchers_string.h
  96. 0
    93
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_matchers_string.hpp
  97. 0
    101
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_matchers_vector.h
  98. 0
    66
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_message.h
  99. 0
    47
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_message.hpp
  100. 0
    0
      libraries/Lora_Serialization/test/lib/Catch/include/internal/catch_notimplemented_exception.h

+ 0
- 7
libraries/Lora_Serialization/test/.eslintrc.js View File

@@ -1,7 +0,0 @@
module.exports = {
"extends": "../.eslintrc.js",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": 'module',
}
}

+ 0
- 37
libraries/Lora_Serialization/test/LoraMessage.js View File

@@ -1,37 +0,0 @@
import test from 'ava';
import { encoder, LoraMessage } from '../src';
import base from './base';

test('should be possible to construct a simple message', t => {
const m = new LoraMessage(encoder);
m.addUnixtime(base.unixtime);
t.is(m.getLength(), 4);
t.deepEqual(m.getBytes(), base.unixtimeBytes);
t.pass();
});

test('should be possible to chain message parts', t => {
const loraMessage = new LoraMessage(encoder);
t.deepEqual(
loraMessage
.addLatLng.apply(loraMessage, base.latLng)
.addUnixtime(base.unixtime)
.addUint16(base.uint16)
.addTemperature(base.temp)
.addUint8(base.uint8)
.addHumidity(base.humidity)
.addBitmap.apply(loraMessage, base.bitmapArgs)
.getBytes()
,
Buffer.concat([
base.latLngBytes,
base.unixtimeBytes,
base.uint16Bytes,
base.tempBytes,
base.uint8Bytes,
base.humidityBytes,
base.bitmapBytes,
])
);
t.pass();
});

+ 0
- 18
libraries/Lora_Serialization/test/Makefile View File

@@ -1,18 +0,0 @@
CC = g++

# -g adds debugging information to the executable file
# -Wall turns on most, but not all, compiler warnings
CFLAGS = -g -Wall --coverage

TARGET = main

all: $(TARGET)

$(TARGET): $(TARGET).cpp
$(CC) $(CFLAGS) -o $(TARGET) $(TARGET).cpp

test:
./main

clean:
$(RM) $(TARGET) $(TARGET).gcda $(TARGET).gcno

+ 0
- 39
libraries/Lora_Serialization/test/base.js View File

@@ -1,39 +0,0 @@
module.exports = {
unixtimeBytes: new Buffer([0x1d, 0x4b, 0x7a, 0x57]),
unixtime: 1467632413,
uint8Bytes: new Buffer([0xFF]),
uint8: 255,
uint16Bytes: new Buffer([0x9d, 0x5b]),
uint16: 23453,
tempBytes: new Buffer([0x1f, 0x4c]),
temp: 80.12,
negativeTempBytes: new Buffer([0xcf, 0xc7]),
negativeTemp: -123.45,
humidityBytes: new Buffer([0x0f, 0x27]),
humidity: 99.99,
latLngBytes: new Buffer([0x64, 0xa6, 0xfa, 0xfd, 0x6a, 0x24, 0x04, 0x09]),
latLng: [-33.905052, 151.26641],
bitmapArgs: [true, true, true, true, true, true, false, true],
bitmap: {
a: true,
b: true,
c: true,
d: true,
e: true,
f: true,
g: false,
h: true
},
bitmapBytes: new Buffer([253]),
bitmap2: {
a: false,
b: true,
c: false,
d: false,
e: false,
f: false,
g: false,
h: false
},
bitmap2Bytes: new Buffer([64]),
};

+ 0
- 20
libraries/Lora_Serialization/test/decoder/bitmap.js View File

@@ -1,20 +0,0 @@
import test from 'ava';
import { decoder } from '../../src';
import base from '../base';

test('should yell at you if the buffer is omitted', t => {
t.throws(() => decoder.bitmap(), /undefined/);
t.pass();
});
test('should yell at you if the buffer size is incorrect', t => {
t.throws(() => decoder.bitmap(new Buffer([1, 2])), /must have/);
t.pass();
});
test('should be possible to decode a bitmap', t => {
t.deepEqual(decoder.bitmap(base.bitmapBytes), base.bitmap);
t.pass();
});
test('should be possible to decode a bitmap with leading false', t => {
t.deepEqual(decoder.bitmap(base.bitmap2Bytes), base.bitmap2);
t.pass();
});

+ 0
- 52
libraries/Lora_Serialization/test/decoder/decode.js View File

@@ -1,52 +0,0 @@
import test from 'ava';
import { decoder } from '../../src';
import base from '../base';

test('should be able to compose decoder functions', t => {
t.deepEqual(
decoder.decode(
Buffer.concat([
base.latLngBytes,
base.unixtimeBytes,
base.uint16Bytes,
base.tempBytes,
base.uint8Bytes,
base.humidityBytes,
base.bitmapBytes,
]), [
decoder.latLng,
decoder.unixtime,
decoder.uint16,
decoder.temperature,
decoder.uint8,
decoder.humidity,
decoder.bitmap,
]
),
{
0: base.latLng,
1: base.unixtime,
2: base.uint16,
3: base.temp,
4: base.uint8,
5: base.humidity,
6: base.bitmap,
}
);
t.pass();
});

test('should yell at you if mask is longer than input', t => {
t.throws(() => decoder.decode(new Buffer(7), [decoder.latLng]), /Mask/i);
t.pass();
});

test('should be able to take names', t => {
t.deepEqual(
decoder.decode(base.unixtimeBytes, [decoder.unixtime], ['time']),
{
time: base.unixtime
}
);
t.pass();
});

+ 0
- 18
libraries/Lora_Serialization/test/decoder/humidity.js View File

@@ -1,18 +0,0 @@
import test from 'ava';
import { decoder } from '../../src';
import base from '../base';

test('should yell at you if the buffer is omitted', t => {
t.throws(() => decoder.humidity(), /undefined/);
t.pass();
});

test('should yell at you if the buffer size is incorrect', t => {
t.throws(() => decoder.humidity(new Buffer([1])), /must have/);
t.pass();
});

test('should be possible to decode a humidity', t => {
t.is(decoder.humidity(base.humidityBytes), base.humidity);
t.pass();
});

+ 0
- 18
libraries/Lora_Serialization/test/decoder/latLng.js View File

@@ -1,18 +0,0 @@
import test from 'ava';
import { decoder } from '../../src';
import base from '../base';

test('should yell at you if the buffer is omitted', t => {
t.throws(() => decoder.latLng(), /undefined/);
t.pass();
});

test('should yell at you if the buffer size is incorrect', t => {
t.throws(() => decoder.latLng(new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9])), /must have/);
t.pass();
});

test('should be possible to decode a coordinate', t => {
t.deepEqual(decoder.latLng(base.latLngBytes), base.latLng);
t.pass();
});

+ 0
- 23
libraries/Lora_Serialization/test/decoder/temperature.js View File

@@ -1,23 +0,0 @@
import test from 'ava';
import { decoder } from '../../src';
import base from '../base';

test('should yell at you if the buffer is omitted', t => {
t.throws(() => decoder.temperature(), /undefined/);
t.pass();
});

test('should yell at you if the buffer size is incorrect', t => {
t.throws(() => decoder.temperature(new Buffer([1])), /must have/);
t.pass();
});

test('should be possible to decode a temperature', t => {
t.is(decoder.temperature(base.tempBytes), base.temp);
t.pass();
});

test('should be possible to decode a negative temperature', t => {
t.is(decoder.temperature(base.negativeTempBytes), base.negativeTemp);
t.pass();
});

+ 0
- 18
libraries/Lora_Serialization/test/decoder/uint16.js View File

@@ -1,18 +0,0 @@
import test from 'ava';
import { decoder } from '../../src';
import base from '../base';

test('should yell at you if the buffer is omitted', t => {
t.throws(() => decoder.uint16(), /undefined/);
t.pass();
});

test('should yell at you if the buffer size is incorrect', t => {
t.throws(() => decoder.uint16(new Buffer([1])), /must have/);
t.pass();
});

test('should be possible to decode an int', t => {
t.is(decoder.uint16(base.uint16Bytes), base.uint16);
t.pass();
});

+ 0
- 18
libraries/Lora_Serialization/test/decoder/uint8.js View File

@@ -1,18 +0,0 @@
import test from 'ava';
import { decoder } from '../../src';
import base from '../base';

test('should yell at you if the buffer is omitted', t => {
t.throws(() => decoder.uint8(), /undefined/);
t.pass();
});

test('should yell at you if the buffer size is incorrect', t => {
t.throws(() => decoder.uint8(new Buffer([1, 2])), /must have/);
t.pass();
});

test('should be possible to decode an int', t => {
t.is(decoder.uint8(base.uint8Bytes), base.uint8);
t.pass();
});

+ 0
- 18
libraries/Lora_Serialization/test/decoder/unixtime.js View File

@@ -1,18 +0,0 @@
import test from 'ava';
import { decoder } from '../../src';
import base from '../base';

test('should yell at you if the buffer is omitted', t => {
t.throws(() => decoder.unixtime(), /undefined/);
t.pass();
});

test('should yell at you if the buffer size is incorrect', t => {
t.throws(() => decoder.unixtime(new Buffer([1, 2])), /must have/);
t.pass();
});

test('should be possible to decode a unixtime', t => {
t.is(decoder.unixtime(base.unixtimeBytes), base.unixtime);
t.pass();
});

+ 0
- 19
libraries/Lora_Serialization/test/encoder/bitmap.js View File

@@ -1,19 +0,0 @@
import test from 'ava';
import { encoder } from '../../src';
import base from '../base';

test('should yell at you if the bitmap is incorrect', t => {
t.throws(() => encoder.bitmap(1), TypeError);
t.throws(() => encoder.bitmap('a'), TypeError);
t.pass();
});

test('should be possible to encode a bitmap', t => {
t.deepEqual(encoder.bitmap.apply(encoder, base.bitmapArgs), base.bitmapBytes);
t.pass();
});

test('should be possible to encode a short bitmap', t => {
t.deepEqual(encoder.bitmap(true), new Buffer([0x80]));
t.pass();
});

+ 0
- 48
libraries/Lora_Serialization/test/encoder/encode.js View File

@@ -1,48 +0,0 @@
import test from 'ava';
import { encoder } from '../../src';
import base from '../base';

test('should yell at you if input is incorrect', t => {
t.throws(() => encoder.encode(), /values/i);
t.throws(() => encoder.encode([]), /mask/i);
t.pass();
});

test('should yell at you if input is longer than mask', t => {
t.throws(() => encoder.encode([1,2,3], [encoder.latLng]), /Mask/i);
t.pass();
});

test('should be able to compose encoder functions', t => {
t.deepEqual(encoder
.encode(
[
base.latLng,
base.unixtime,
base.uint16,
base.temp,
base.uint8,
base.humidity,
base.bitmapArgs,
],
[
encoder.latLng,
encoder.unixtime,
encoder.uint16,
encoder.temperature,
encoder.uint8,
encoder.humidity,
encoder.bitmap,
]),
Buffer.concat([
base.latLngBytes,
base.unixtimeBytes,
base.uint16Bytes,
base.tempBytes,
base.uint8Bytes,
base.humidityBytes,
base.bitmapBytes,
])
);
t.pass();
});

+ 0
- 17
libraries/Lora_Serialization/test/encoder/humidity.js View File

@@ -1,17 +0,0 @@
import test from 'ava';
import { encoder } from '../../src';
import base from '../base';

test('should yell at you if the humidity is omitted', t => {
t.throws(() => encoder.humidity());
t.pass();
});
test('should yell at you if the humidity is incorrect', t => {
t.throws(() => encoder.humidity(-0.01), /range/);
t.throws(() => encoder.humidity(100.01), /range/);
t.pass();
});
test('should be possible to encode a humidity', t => {
t.deepEqual(encoder.humidity(base.humidity), base.humidityBytes);
t.pass();
});

+ 0
- 22
libraries/Lora_Serialization/test/encoder/latLng.js View File

@@ -1,22 +0,0 @@
import test from 'ava';
import { encoder } from '../../src';
import base from '../base';

test('should yell at you if the coordinates are omitted', t => {
t.throws(() => encoder.latLng(), /latitude/i);
t.throws(() => encoder.latLng(0), /longitude/i);
t.pass();
});

test('should yell at you if the coordinates are incorrect', t => {
t.throws(() => encoder.latLng(-90.000001, 0), /latitude/i);
t.throws(() => encoder.latLng(90.000001, 0), /latitude/i);
t.throws(() => encoder.latLng(0, -180.000001), /longitude/i);
t.throws(() => encoder.latLng(0, 180.000001), /longitude/i);
t.pass();
});

test('should be possible to decode a coordinate', t => {
t.deepEqual(encoder.latLng(...base.latLng), base.latLngBytes);
t.pass();
});

+ 0
- 24
libraries/Lora_Serialization/test/encoder/temperature.js View File

@@ -1,24 +0,0 @@
import test from 'ava';
import { encoder } from '../../src';
import base from '../base';

test('should yell at you if the temperature is omitted', t => {
t.throws(() => encoder.temperature());
t.pass();
});

test('should yell at you if the temperature is incorrect', t => {
t.throws(() => encoder.temperature(-327.69), /range/);
t.throws(() => encoder.temperature(327.68), /range/);
t.pass();
});

test('should be possible to encode a temperature', t => {
t.deepEqual(encoder.temperature(base.temp), base.tempBytes);
t.pass();
});

test('should be possible to encode a negative temperature', t => {
t.deepEqual(encoder.temperature(base.negativeTemp), base.negativeTempBytes);
t.pass();
});

+ 0
- 19
libraries/Lora_Serialization/test/encoder/uint16.js View File

@@ -1,19 +0,0 @@
import test from 'ava';
import { encoder } from '../../src';
import base from '../base';

test('should yell at you if the uint is omitted', t => {
t.throws(() => encoder.uint16());
t.pass();
});

test('should yell at you if the uint size is incorrect', t => {
t.throws(() => encoder.uint16(-1), /range/);
t.throws(() => encoder.uint16(65536), /range/);
t.pass();
});

test('should be possible to encode an int', t => {
t.deepEqual(encoder.uint16(base.uint16), base.uint16Bytes);
t.pass();
});

+ 0
- 19
libraries/Lora_Serialization/test/encoder/uint8.js View File

@@ -1,19 +0,0 @@
import test from 'ava';
import { encoder } from '../../src';
import base from '../base';

test('should yell at you if the uint is omitted', t => {
t.throws(() => encoder.uint8());
t.pass();
});

test('should yell at you if the uint is incorrect', t => {
t.throws(() => encoder.uint8(-1), /range/);
t.throws(() => encoder.uint8(256), /range/);
t.pass();
});

test('should be possible to encode an int', t => {
t.deepEqual(encoder.uint8(base.uint8), base.uint8Bytes);
t.pass();
});

+ 0
- 18
libraries/Lora_Serialization/test/encoder/unixtime.js View File

@@ -1,18 +0,0 @@
import test from 'ava';
import { encoder } from '../../src';
import base from '../base';

test('should yell at you if the unixtime is omitted', t => {
t.throws(() => encoder.unixtime());
t.pass();
});

test('should yell at you if the unixtime is incorrect', t => {
t.throws(() => encoder.unixtime(-1), /positive/);
t.pass();
});

test('should be possible to encode a unixtime', t => {
t.deepEqual(encoder.unixtime(base.unixtime), base.unixtimeBytes);
t.pass();
});

+ 0
- 12
libraries/Lora_Serialization/test/helpers.cpp View File

@@ -1,12 +0,0 @@
void printByteArrayToHex(byte *arr) {
for(int i = 0; i < sizeof(arr); i++) {
printf("%02x", arr[i]);
}
printf("\n");
}

void compare_array(byte *arr1, byte *arr2, int start, int len) {
for(int i = start; i < start + len; i++) {
REQUIRE(arr1[i] == arr2[i]);
}
}

+ 0
- 11
libraries/Lora_Serialization/test/lib/Catch/.gitattributes View File

@@ -1,11 +0,0 @@
# This sets the default behaviour, overriding core.autocrlf
* text=auto

# All source files should have unix line-endings in the repository,
# but convert to native line-endings on checkout
*.cpp text
*.h text
*.hpp text

# Windows specific files should retain windows line-endings
*.sln text eol=crlf

+ 0
- 29
libraries/Lora_Serialization/test/lib/Catch/.github/issue_template.md View File

@@ -1,29 +0,0 @@
## Description
<!--
If your issue is a bugreport, this means describing what you did,
what did you want to happen and what actually did happen.

If your issue is a feature request, describe the feature and why do you
want it.
-->


### Steps to reproduce
<!--
This is only relevant for bug reports, but if you do have one,
please provide a minimal set of steps to reproduce the problem.

Usually this means providing a small and self-contained code using Catch
and specifying compiler flags/tools used if relevant.
-->


### Extra information
<!--
Fill in any extra information that might be important for your issue.

If your issue is a bugreport, definitely fill out at least the following.
-->
* Catch version: **v42.42.42**
* Operating System: **Joe's discount operating system**
* Compiler+version: **Hidden Dragon v1.2.3**

+ 0
- 25
libraries/Lora_Serialization/test/lib/Catch/.github/pull_request_template.md View File

@@ -1,25 +0,0 @@
<!--
Please do not submit pull requests changing the `version.hpp`
or the single-include `catch.hpp` file, these are changed
only when a new release is made.
-->


## Description
<!--
Describe the what and the why of your pull request. Remember that these two
are usually a bit different. As an example, if you have made various changes
to decrease the number of new strings allocated, thats what. The why probably
was that you have a large set of tests and found that this speeds them up.
-->

## GitHub Issues
<!--
If this PR was motivated by some existing issues, reference them here.

If it is a simple bug-fix, please also add a line like 'Closes #123'
to your commit message, so that it is automatically closed.
If it is not, don't, as it might take several iterations for a feature
to be done properly. If in doubt, leave it open and reference it in the
PR itself, so that maintainers can decide.
-->

+ 0
- 29
libraries/Lora_Serialization/test/lib/Catch/.gitignore View File

@@ -1,29 +0,0 @@
*.build
*.pbxuser
*.mode1v3
*.ncb
*.suo
Debug
Release
*.user
*.xcuserstate
.DS_Store
xcuserdata
CatchSelfTest.xcscheme
Breakpoints.xcbkptlist
projects/VS2010/TestCatch/_UpgradeReport_Files/
projects/VS2010/TestCatch/TestCatch/TestCatch.vcxproj.filters
projects/VisualStudio/TestCatch/UpgradeLog.XML
projects/CMake/.idea
projects/CMake/cmake-build-debug
UpgradeLog.XML
Resources/DWARF
projects/Generated
*.pyc
DerivedData
*.xccheckout
Build
.idea
cmake-build-debug
cmake-build-release
.vs

+ 0
- 232
libraries/Lora_Serialization/test/lib/Catch/.travis.yml View File

@@ -1,232 +0,0 @@
language: cpp
sudo: false

matrix:
include:

# 1/ Linux Clang Builds
- os: linux
compiler: clang
addons: &clang34
apt:
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
packages: ['clang']
env: COMPILER='clang++' BUILD_TYPE='Release' CPP11=0

- os: linux
compiler: clang
addons: *clang34
env: COMPILER='clang++' BUILD_TYPE='Debug' CPP11=0
- os: linux
compiler: clang
addons: &clang35
apt:
sources: ['llvm-toolchain-precise-3.5', 'ubuntu-toolchain-r-test']
packages: ['clang-3.5']
env: COMPILER='clang++-3.5' BUILD_TYPE='Release' CPP11=0

- os: linux
compiler: clang
addons: *clang35
env: COMPILER='clang++-3.5' BUILD_TYPE='Debug' CPP11=0


- os: linux
compiler: clang
addons: &clang36
apt:
sources: ['llvm-toolchain-precise-3.6', 'ubuntu-toolchain-r-test']
packages: ['clang-3.6']
env: COMPILER='clang++-3.6' BUILD_TYPE='Release' CPP11=0

- os: linux
compiler: clang
addons: *clang36
env: COMPILER='clang++-3.6' BUILD_TYPE='Debug' CPP11=0


- os: linux
compiler: clang
addons: &clang37
apt:
sources: ['llvm-toolchain-precise-3.7', 'ubuntu-toolchain-r-test']
packages: ['clang-3.7']
env: COMPILER='clang++-3.7' BUILD_TYPE='Release' CPP11=0

- os: linux
compiler: clang
addons: *clang37
env: COMPILER='clang++-3.7' BUILD_TYPE='Debug' CPP11=0


- os: linux
compiler: clang
addons: &clang38
apt:
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
packages: ['clang-3.8']
env: COMPILER='clang++-3.8' BUILD_TYPE='Release' CPP11=0

- os: linux
compiler: clang
addons: *clang38
env: COMPILER='clang++-3.8' BUILD_TYPE='Debug' CPP11=0


# 2/ Linux GCC Builds
- os: linux
compiler: gcc
addons: &gcc44
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.4']
env: COMPILER='g++-4.4' BUILD_TYPE='Release' CPP11=0

- os: linux
compiler: gcc
addons: *gcc44
env: COMPILER='g++-4.4' BUILD_TYPE='Debug' CPP11=0


- os: linux
compiler: gcc
addons: &gcc47
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.7']
env: COMPILER='g++-4.7' BUILD_TYPE='Release' CPP11=0

- os: linux
compiler: gcc
addons: *gcc47
env: COMPILER='g++-4.7' BUILD_TYPE='Debug' CPP11=0


- os: linux
compiler: gcc
addons: &gcc48
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.8']
env: COMPILER='g++-4.8' BUILD_TYPE='Release' CPP11=0

- os: linux
compiler: gcc
addons: *gcc48
env: COMPILER='g++-4.8' BUILD_TYPE='Debug' CPP11=0


- os: linux
compiler: gcc
addons: &gcc49
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9']
env: COMPILER='g++-4.9' BUILD_TYPE='Release' CPP11=0

- os: linux
compiler: gcc
addons: *gcc49
env: COMPILER='g++-4.9' BUILD_TYPE='Debug' CPP11=0


- os: linux
compiler: gcc
addons: &gcc5
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5']
env: COMPILER='g++-5' BUILD_TYPE='Release' CPP11=0

- os: linux
compiler: gcc
addons: *gcc5
env: COMPILER='g++-5' BUILD_TYPE='Debug' CPP11=0


- os: linux
compiler: gcc
addons: &gcc6
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6']
env: COMPILER='g++-6' BUILD_TYPE='Release' CPP11=0

- os: linux
compiler: gcc
addons: *gcc6
env: COMPILER='g++-6' BUILD_TYPE='Debug' CPP11=0

# 3a/ Linux C++11 GCC builds
- os: linux
compiler: gcc
addons: &gcc48
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.8']
env: COMPILER='g++-4.8' BUILD_TYPE='Release' CPP11=1

- os: linux
compiler: gcc
addons: *gcc48
env: COMPILER='g++-4.8' BUILD_TYPE='Debug' CPP11=1

# 3b/ Linux C++11 Clang builds
- os: linux
compiler: clang
addons: &clang38
apt:
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
packages: ['clang-3.8']
env: COMPILER='clang++-3.8' BUILD_TYPE='Release' CPP11=1

- os: linux
compiler: clang
addons: *clang38
env: COMPILER='clang++-3.8' BUILD_TYPE='Debug' CPP11=1


# 4/ OSX Clang Builds
- os: osx
osx_image: xcode7.3
compiler: clang
env: COMPILER='clang++' BUILD_TYPE='Debug' CPP11=0

- os: osx
osx_image: xcode7.3
compiler: clang
env: COMPILER='clang++' BUILD_TYPE='Release' CPP11=0

- os: osx
osx_image: xcode8
compiler: clang
env: COMPILER='clang++' BUILD_TYPE='Debug' CPP11=0

- os: osx
osx_image: xcode8
compiler: clang
env: COMPILER='clang++' BUILD_TYPE='Release' CPP11=0


install:
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="http://www.cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
which cmake || brew install cmake
fi

before_script:
- export CXX=${COMPILER}
- cd ${TRAVIS_BUILD_DIR}
- cmake -H. -BBuild -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -Wdev -DUSE_CPP11=${CPP11}
- cd Build

script:
- make -j 2
- ctest -V -j 2

+ 0
- 271
libraries/Lora_Serialization/test/lib/Catch/CMakeLists.txt View File

@@ -1,271 +0,0 @@
cmake_minimum_required(VERSION 3.0)

project(CatchSelfTest)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# define some folders
set(CATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(SELF_TEST_DIR ${CATCH_DIR}/projects/SelfTest)
set(BENCHMARK_DIR ${CATCH_DIR}/projects/Benchmark)
set(HEADER_DIR ${CATCH_DIR}/include)

if(USE_CPP11)
## We can't turn this on by default, since it breaks on travis
message(STATUS "Enabling C++11")
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
elseif(USE_CPP14)
message(STATUS "Enabling C++14")
set(CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS}")
endif()

#checks that the given hard-coded list contains all headers + sources in the given folder
function(CheckFileList LIST_VAR FOLDER)
set(MESSAGE " should be added to the variable ${LIST_VAR}")
set(MESSAGE "${MESSAGE} in ${CMAKE_CURRENT_LIST_FILE}\n")
file(GLOB GLOBBED_LIST "${FOLDER}/*.cpp"
"${FOLDER}/*.hpp"
"${FOLDER}/*.h")
list(REMOVE_ITEM GLOBBED_LIST ${${LIST_VAR}})
foreach(EXTRA_ITEM ${GLOBBED_LIST})
string(REPLACE "${CATCH_DIR}/" "" RELATIVE_FILE_NAME "${EXTRA_ITEM}")
message(AUTHOR_WARNING "The file \"${RELATIVE_FILE_NAME}\"${MESSAGE}")
endforeach()
endfunction()

function(CheckFileListRec LIST_VAR FOLDER)
set(MESSAGE " should be added to the variable ${LIST_VAR}")
set(MESSAGE "${MESSAGE} in ${CMAKE_CURRENT_LIST_FILE}\n")
file(GLOB_RECURSE GLOBBED_LIST "${FOLDER}/*.cpp"
"${FOLDER}/*.hpp"
"${FOLDER}/*.h")
list(REMOVE_ITEM GLOBBED_LIST ${${LIST_VAR}})
foreach(EXTRA_ITEM ${GLOBBED_LIST})
string(REPLACE "${CATCH_DIR}/" "" RELATIVE_FILE_NAME "${EXTRA_ITEM}")
message(AUTHOR_WARNING "The file \"${RELATIVE_FILE_NAME}\"${MESSAGE}")
endforeach()
endfunction()

# define the sources of the self test
# Please keep these ordered alphabetically
set(TEST_SOURCES
${SELF_TEST_DIR}/ApproxTests.cpp
${SELF_TEST_DIR}/BDDTests.cpp
${SELF_TEST_DIR}/ClassTests.cpp
${SELF_TEST_DIR}/CmdLineTests.cpp
${SELF_TEST_DIR}/CompilationTests.cpp
${SELF_TEST_DIR}/ConditionTests.cpp
${SELF_TEST_DIR}/EnumToString.cpp
${SELF_TEST_DIR}/ExceptionTests.cpp
${SELF_TEST_DIR}/GeneratorTests.cpp
${SELF_TEST_DIR}/MessageTests.cpp
${SELF_TEST_DIR}/MiscTests.cpp
${SELF_TEST_DIR}/PartTrackerTests.cpp
${SELF_TEST_DIR}/TagAliasTests.cpp
${SELF_TEST_DIR}/TestMain.cpp
${SELF_TEST_DIR}/ToStringGeneralTests.cpp
${SELF_TEST_DIR}/ToStringPair.cpp
${SELF_TEST_DIR}/ToStringTuple.cpp
${SELF_TEST_DIR}/ToStringVector.cpp
${SELF_TEST_DIR}/ToStringWhich.cpp
${SELF_TEST_DIR}/TrickyTests.cpp
${SELF_TEST_DIR}/VariadicMacrosTests.cpp
${SELF_TEST_DIR}/MatchersTests.cpp
)
CheckFileList(TEST_SOURCES ${SELF_TEST_DIR})

# A set of impl files that just #include a single header
# Please keep these ordered alphabetically
set(IMPL_SOURCES
${SELF_TEST_DIR}/SurrogateCpps/catch_common.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_console_colour.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_debugger.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_capture.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_config.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_exception.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_generators.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_registry_hub.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_reporter.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_runner.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_testcase.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_message.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_option.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_ptr.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_stream.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_streambuf.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_test_spec.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_xmlwriter.cpp
${SELF_TEST_DIR}/SurrogateCpps/catch_test_case_tracker.cpp
)
CheckFileList(IMPL_SOURCES ${SELF_TEST_DIR}/SurrogateCpps)


# Please keep these ordered alphabetically
set(TOP_LEVEL_HEADERS
${HEADER_DIR}/catch.hpp
${HEADER_DIR}/catch_session.hpp
${HEADER_DIR}/catch_with_main.hpp
)
CheckFileList(TOP_LEVEL_HEADERS ${HEADER_DIR})

# Please keep these ordered alphabetically
set(EXTERNAL_HEADERS
${HEADER_DIR}/external/clara.h
${HEADER_DIR}/external/tbc_text_format.h
)
CheckFileList(EXTERNAL_HEADERS ${HEADER_DIR}/external)


# Please keep these ordered alphabetically
set(INTERNAL_HEADERS
${HEADER_DIR}/internal/catch_approx.hpp
${HEADER_DIR}/internal/catch_assertionresult.h
${HEADER_DIR}/internal/catch_assertionresult.hpp
${HEADER_DIR}/internal/catch_capture.hpp
${HEADER_DIR}/internal/catch_clara.h
${HEADER_DIR}/internal/catch_commandline.hpp
${HEADER_DIR}/internal/catch_common.h
${HEADER_DIR}/internal/catch_common.hpp
${HEADER_DIR}/internal/catch_compiler_capabilities.h
${HEADER_DIR}/internal/catch_config.hpp
${HEADER_DIR}/internal/catch_console_colour.hpp
${HEADER_DIR}/internal/catch_console_colour_impl.hpp
${HEADER_DIR}/internal/catch_context.h
${HEADER_DIR}/internal/catch_context_impl.hpp
${HEADER_DIR}/internal/catch_debugger.h
${HEADER_DIR}/internal/catch_debugger.hpp
${HEADER_DIR}/internal/catch_default_main.hpp
${HEADER_DIR}/internal/catch_evaluate.hpp
${HEADER_DIR}/internal/catch_exception_translator_registry.hpp
${HEADER_DIR}/internal/catch_expression_lhs.hpp
${HEADER_DIR}/internal/catch_fatal_condition.hpp
${HEADER_DIR}/internal/catch_generators.hpp
${HEADER_DIR}/internal/catch_generators_impl.hpp
${HEADER_DIR}/internal/catch_impl.hpp
${HEADER_DIR}/internal/catch_interfaces_capture.h
${HEADER_DIR}/internal/catch_interfaces_config.h
${HEADER_DIR}/internal/catch_interfaces_exception.h
${HEADER_DIR}/internal/catch_interfaces_generators.h
${HEADER_DIR}/internal/catch_interfaces_registry_hub.h
${HEADER_DIR}/internal/catch_interfaces_reporter.h
${HEADER_DIR}/internal/catch_interfaces_runner.h
${HEADER_DIR}/internal/catch_interfaces_tag_alias_registry.h
${HEADER_DIR}/internal/catch_interfaces_testcase.h
${HEADER_DIR}/internal/catch_legacy_reporter_adapter.h
${HEADER_DIR}/internal/catch_legacy_reporter_adapter.hpp
${HEADER_DIR}/internal/catch_list.hpp
${HEADER_DIR}/internal/catch_matchers.hpp
${HEADER_DIR}/internal/catch_matchers_string.h
${HEADER_DIR}/internal/catch_matchers_string.hpp
${HEADER_DIR}/internal/catch_matchers_vector.h
${HEADER_DIR}/internal/catch_message.h
${HEADER_DIR}/internal/catch_message.hpp
${HEADER_DIR}/internal/catch_notimplemented_exception.h
${HEADER_DIR}/internal/catch_notimplemented_exception.hpp
${HEADER_DIR}/internal/catch_objc.hpp
${HEADER_DIR}/internal/catch_objc_arc.hpp
${HEADER_DIR}/internal/catch_option.hpp
${HEADER_DIR}/internal/catch_platform.h
${HEADER_DIR}/internal/catch_ptr.hpp
${HEADER_DIR}/internal/catch_reenable_warnings.h
${HEADER_DIR}/internal/catch_registry_hub.hpp
${HEADER_DIR}/internal/catch_reporter_registrars.hpp
${HEADER_DIR}/internal/catch_reporter_registry.hpp
${HEADER_DIR}/internal/catch_result_builder.h
${HEADER_DIR}/internal/catch_result_builder.hpp
${HEADER_DIR}/internal/catch_result_type.h
${HEADER_DIR}/internal/catch_run_context.hpp
${HEADER_DIR}/internal/catch_section.h
${HEADER_DIR}/internal/catch_section.hpp
${HEADER_DIR}/internal/catch_section_info.h
${HEADER_DIR}/internal/catch_section_info.hpp
${HEADER_DIR}/internal/catch_stream.h
${HEADER_DIR}/internal/catch_stream.hpp
${HEADER_DIR}/internal/catch_streambuf.h
${HEADER_DIR}/internal/catch_suppress_warnings.h
${HEADER_DIR}/internal/catch_tag_alias.h
${HEADER_DIR}/internal/catch_tag_alias_registry.h
${HEADER_DIR}/internal/catch_tag_alias_registry.hpp
${HEADER_DIR}/internal/catch_test_case_info.h
${HEADER_DIR}/internal/catch_test_case_info.hpp
${HEADER_DIR}/internal/catch_test_case_registry_impl.hpp
${HEADER_DIR}/internal/catch_test_case_tracker.hpp
${HEADER_DIR}/internal/catch_test_registry.hpp
${HEADER_DIR}/internal/catch_test_spec.hpp
${HEADER_DIR}/internal/catch_test_spec_parser.hpp
${HEADER_DIR}/internal/catch_text.h
${HEADER_DIR}/internal/catch_timer.h
${HEADER_DIR}/internal/catch_timer.hpp
${HEADER_DIR}/internal/catch_tostring.h
${HEADER_DIR}/internal/catch_tostring.hpp
${HEADER_DIR}/internal/catch_totals.hpp
${HEADER_DIR}/internal/catch_type_traits.hpp
${HEADER_DIR}/internal/catch_version.h
${HEADER_DIR}/internal/catch_version.hpp
${HEADER_DIR}/internal/catch_wildcard_pattern.hpp
${HEADER_DIR}/internal/catch_windows_h_proxy.h
${HEADER_DIR}/internal/catch_xmlwriter.hpp
)
CheckFileList(INTERNAL_HEADERS ${HEADER_DIR}/internal)

# Please keep these ordered alphabetically
set(REPORTER_HEADERS
${HEADER_DIR}/reporters/catch_reporter_automake.hpp
${HEADER_DIR}/reporters/catch_reporter_bases.hpp
${HEADER_DIR}/reporters/catch_reporter_compact.hpp
${HEADER_DIR}/reporters/catch_reporter_console.hpp
${HEADER_DIR}/reporters/catch_reporter_junit.hpp
${HEADER_DIR}/reporters/catch_reporter_multi.hpp
${HEADER_DIR}/reporters/catch_reporter_tap.hpp
${HEADER_DIR}/reporters/catch_reporter_teamcity.hpp
${HEADER_DIR}/reporters/catch_reporter_xml.hpp
)
CheckFileList(REPORTER_HEADERS ${HEADER_DIR}/reporters)

# Specify the headers, too, so CLion recognises them as project files
set(HEADERS
${TOP_LEVEL_HEADERS}
${EXTERNAL_HEADERS}
${INTERNAL_HEADERS}
${REPORTER_HEADERS}
)


set(BENCH_SOURCES
${BENCHMARK_DIR}/BenchMain.cpp
${BENCHMARK_DIR}/StringificationBench.cpp
)
CheckFileList(BENCH_SOURCES ${BENCHMARK_DIR})

# Provide some groupings for IDEs
SOURCE_GROUP("Tests" FILES ${TEST_SOURCES})
SOURCE_GROUP("Surrogates" FILES ${IMPL_SOURCES})
SOURCE_GROUP("Benchmarks" FILES ${BENCH_SOURCES})

# configure the executable
include_directories(${HEADER_DIR})
add_executable(SelfTest ${TEST_SOURCES} ${IMPL_SOURCES} ${HEADERS})
add_executable(Benchmark ${BENCH_SOURCES} ${HEADERS})

# Add desired warnings
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" )
target_compile_options( SelfTest PRIVATE -Wall -Wextra )
target_compile_options( Benchmark PRIVATE -Wall -Wextra )
endif()
if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_compile_options( SelfTest PRIVATE /W4 )
target_compile_options( Benchmark PRIVATE /W4 )
endif()


# configure unit tests via CTest
enable_testing()
add_test(NAME RunTests COMMAND SelfTest)

add_test(NAME ListTests COMMAND SelfTest --list-tests)
set_tests_properties(ListTests PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ test cases")

add_test(NAME ListTags COMMAND SelfTest --list-tags)
set_tests_properties(ListTags PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ tags")

install(DIRECTORY "single_include/" DESTINATION "include/catch/")

+ 0
- 23
libraries/Lora_Serialization/test/lib/Catch/LICENSE_1_0.txt View File

@@ -1,23 +0,0 @@
Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

+ 0
- 23
libraries/Lora_Serialization/test/lib/Catch/README.md View File

@@ -1,23 +0,0 @@
![catch logo](catch-logo-small.png)

[![Github Releases](https://img.shields.io/github/release/philsquared/catch.svg)](https://github.com/philsquared/catch/releases)
[![Build Status](https://travis-ci.org/philsquared/Catch.svg?branch=master)](https://travis-ci.org/philsquared/Catch)
[![Build status](https://ci.appveyor.com/api/projects/status/hrtk60hv6tw6fght/branch/master?svg=true)](https://ci.appveyor.com/project/philsquared/catch/branch/master)

<a href="https://github.com/philsquared/Catch/releases/download/v1.8.1/catch.hpp">The latest, single header, version can be downloaded directly using this link</a>

## What's the Catch?

Catch stands for C++ Automated Test Cases in Headers and is a multi-paradigm automated test framework for C++ and Objective-C (and, maybe, C). It is implemented entirely in a set of header files, but is packaged up as a single header for extra convenience.

## How to use it
This documentation comprises these three parts:

* [Why do we need yet another C++ Test Framework?](docs/why-catch.md)
* [Tutorial](docs/tutorial.md) - getting started
* [Reference section](docs/Readme.md) - all the details

## More
* Issues and bugs can be raised on the [Issue tracker on GitHub](https://github.com/philsquared/Catch/issues)
* For discussion or questions please use [the dedicated Google Groups forum](https://groups.google.com/forum/?fromgroups#!forum/catch-forum)
* See [who else is using Catch](docs/opensource-users.md)

+ 0
- 45
libraries/Lora_Serialization/test/lib/Catch/appveyor.yml View File

@@ -1,45 +0,0 @@
# version string format -- This will be overwritten later anyway
version: "{build}"

# Disable the dead branch for v2 development
branches:
except:
- develop-v2

os:
- Visual Studio 2013
- Visual Studio 2015

init:
- git config --global core.autocrlf input
# Set build version to git commit-hash
- ps: Update-AppveyorBuild -Version "$($env:APPVEYOR_REPO_BRANCH) - $($env:APPVEYOR_REPO_COMMIT)"

# fetch repository as zip archive
shallow_clone: true

# Win32 and x64 are CMake-compatible solution platform names.
# This allows us to pass %PLATFORM% to CMake -A.
platform:
- Win32
- x64

# build Configurations, i.e. Debug, Release, etc.
configuration:
- Debug
- Release

#Cmake will autodetect the compiler, but we set the arch
before_build:
- echo Running cmake...
- cmake -H. -BBuild -A%PLATFORM%

# build with MSBuild
build:
project: Build\CatchSelfTest.sln # path to Visual Studio solution or project
parallel: true # enable MSBuild parallel builds
verbosity: normal # MSBuild verbosity level {quiet|minimal|normal|detailed}

test_script:
- cd Build
- ctest -V -j 2 -C %CONFIGURATION%

BIN
libraries/Lora_Serialization/test/lib/Catch/catch-hand-icon.png View File


BIN
libraries/Lora_Serialization/test/lib/Catch/catch-icon-tiny.png View File


BIN
libraries/Lora_Serialization/test/lib/Catch/catch-logo-small.png View File


+ 0
- 23
libraries/Lora_Serialization/test/lib/Catch/docs/Readme.md View File

@@ -1,23 +0,0 @@
These are the currently documented areas of the framework. There is more to come.

Before looking at this material be sure to read the [tutorial](tutorial.md)

* [Assertion macros](assertions.md)
* [Matchers](matchers.md)
* [Logging macros](logging.md)
* [Test cases and sections](test-cases-and-sections.md)
* [Test fixtures](test-fixtures.md)
* [Command line](command-line.md)
* [Build systems](build-systems.md)
* [Supplying your own main()](own-main.md)
* [Configuration](configuration.md)
* [String Conversions](tostring.md)
* [Why are my tests slow to compile?](slow-compiles.md)
* [Known limitations](limitations.md)
Other

* [Why Catch?](why-catch.md)
* [Open Source Projects using Catch](opensource-users.md)
* [Contributing](contributing.md)
* [Release Notes](release-notes.md)

+ 0
- 136
libraries/Lora_Serialization/test/lib/Catch/docs/assertions.md View File

@@ -1,136 +0,0 @@
# Assertion Macros

Most test frameworks have a large collection of assertion macros to capture all possible conditional forms (```_EQUALS```, ```_NOTEQUALS```, ```_GREATER_THAN``` etc).

Catch is different. Because it decomposes natural C-style conditional expressions most of these forms are reduced to one or two that you will use all the time. That said there are a rich set of auxilliary macros as well. We'll describe all of these here.

Most of these macros come in two forms:

## Natural Expressions

The ```REQUIRE``` family of macros tests an expression and aborts the test case if it fails.
The ```CHECK``` family are equivalent but execution continues in the same test case even if the assertion fails. This is useful if you have a series of essentially orthogonal assertions and it is useful to see all the results rather than stopping at the first failure.

* **REQUIRE(** _expression_ **)** and
* **CHECK(** _expression_ **)**

Evaluates the expression and records the result. If an exception is thrown it is caught, reported, and counted as a failure. These are the macros you will use most of the time

Examples:
```
CHECK( str == "string value" );
CHECK( thisReturnsTrue() );
REQUIRE( i == 42 );
```

* **REQUIRE_FALSE(** _expression_ **)** and
* **CHECK_FALSE(** _expression_ **)**

Evaluates the expression and records the _logical NOT_ of the result. If an exception is thrown it is caught, reported, and counted as a failure.
(these forms exist as a workaround for the fact that ! prefixed expressions cannot be decomposed).

Example:
```
REQUIRE_FALSE( thisReturnsFalse() );
```

Do note that "overly complex" expressions cannot be decomposed and thus will not compile. This is done partly for practical reasons (to keep the underlying expression template machinery to minimum) and partly for philosophical reasons (assertions should be simple and deterministic).

Examples:
* `CHECK(a == 1 && b == 2);`
This expression is too complex because of the `&&` operator. If you want to check that 2 or more properties hold, you can either put the expression into parenthesis, which stops decomposition from working, or you need to decompose the expression into two assertions: `CHECK( a == 1 ); CHECK( b == 2);`
* `CHECK( a == 2 || b == 1 );`
This expression is too complex because of the `||` operator. If you want to check that one of several properties hold, you can put the expression into parenthesis (unlike with `&&`, expression decomposition into several `CHECK`s is not possible).


### Floating point comparisons

When comparing floating point numbers - especially if at least one of them has been computed - great care must be taken to allow for rounding errors and inexact representations.

Catch provides a way to perform tolerant comparisons of floating point values through use of a wrapper class called ```Approx```. ```Approx``` can be used on either side of a comparison expression. It overloads the comparisons operators to take a tolerance into account. Here's a simple example:

```
REQUIRE( performComputation() == Approx( 2.1 ) );
```

This way `Approx` is constructed with reasonable defaults, covering most simple cases of rounding errors. If these are insufficient, each `Approx` instance has 3 tuning knobs, that can be used to customize it for your computation.

* __epsilon__ - epsilon serves to set the percentage by which a result can be erroneous, before it is rejected. By default set to `std::numeric_limits<float>::epsilon()*100`.
* __margin__ - margin serves to set the the absolute value by which a result can be erroneous before it is rejected. By default set to `0.0`.
* __scale__ - scale serves to adjust the base for comparison used by epsilon, can be used when By default set to `1.0`.

#### epsilon example
```cpp
Approx target = Approx(100).epsilon(0.01);
100.0 == target; // Obviously true
200.0 == target; // Obviously still false
100.5 == target; // True, because we set target to allow up to 1% error
```

#### margin example
_Margin check is used only if the relative (epsilon and scale based) check fails._
```cpp
Approx target = Approx(100).margin(5);
100.0 == target; // Obviously true
200.0 == target; // Obviously still false
104.0 == target; // True, because we set target to allow absolute error up to 5
```

#### scale
Scale can be useful if the computation leading to the result worked on different scale, than is used by the results (and thus expected errors are on a different scale than would be expected based on the results alone).


## Exceptions

* **REQUIRE_NOTHROW(** _expression_ **)** and
* **CHECK_NOTHROW(** _expression_ **)**

Expects that no exception is thrown during evaluation of the expression.

* **REQUIRE_THROWS(** _expression_ **)** and
* **CHECK_THROWS(** _expression_ **)**

Expects that an exception (of any type) is be thrown during evaluation of the expression.

* **REQUIRE_THROWS_AS(** _expression_, _exception type_ **)** and
* **CHECK_THROWS_AS(** _expression_, _exception type_ **)**

Expects that an exception of the _specified type_ is thrown during evaluation of the expression.

* **REQUIRE_THROWS_WITH(** _expression_, _string or string matcher_ **)** and
* **CHECK_THROWS_WITH(** _expression_, _string or string matcher_ **)**

Expects that an exception is thrown that, when converted to a string, matches the _string_ or _string matcher_ provided (see next section for Matchers).

e.g.
```cpp
REQUIRE_THROWS_WITH( openThePodBayDoors(), Contains( "afraid" ) && Contains( "can't do that" ) );
REQUIRE_THROWS_WITH( dismantleHal(), "My mind is going" );
```


Please note that the `THROW` family of assertions expects to be passed a single expression, not a statement or series of statements. If you want to check a more complicated sequence of operations, you can use a C++11 lambda function.

```cpp
REQUIRE_NOTHROW([&](){
int i = 1;
int j = 2;
auto k = i + j;
if (k == 3) {
throw 1;
}
}());
```

## Matcher expressions

To support Matchers a slightly different form is used. Matchers have [their own documentation](matchers.md).

* **REQUIRE_THAT(** _lhs_, _matcher expression_ **)** and
* **CHECK_THAT(** _lhs_, _matcher expression_ **)**

Matchers can be composed using `&&`, `||` and `!` operators.

---

[Home](Readme.md)

+ 0
- 95
libraries/Lora_Serialization/test/lib/Catch/docs/build-systems.md View File

@@ -1,95 +0,0 @@
# Integration with build systems

Build Systems may refer to low-level tools, like CMake, or larger systems that run on servers, like Jenkins or TeamCity. This page will talk about both.

# Continuous Integration systems

Probably the most important aspect to using Catch with a build server is the use of different reporters. Catch comes bundled with three reporters that should cover the majority of build servers out there - although adding more for better integration with some is always a possibility (currently we also offer TeamCity, TAP and Automake reporters).

Two of these reporters are built in (XML and JUnit) and the third (TeamCity) is included as a separate header. It's possible that the other two may be split out in the future too - as that would make the core of Catch smaller for those that don't need them.

## XML Reporter
```-r xml```

The XML Reporter writes in an XML format that is specific to Catch.

The advantage of this format is that it corresponds well to the way Catch works (especially the more unusual features, such as nested sections) and is a fully streaming format - that is it writes output as it goes, without having to store up all its results before it can start writing.

The disadvantage is that, being specific to Catch, no existing build servers understand the format natively. It can be used as input to an XSLT transformation that could covert it to, say, HTML - although this loses the streaming advantage, of course.

## JUnit Reporter
```-r junit```

The JUnit Reporter writes in an XML format that mimics the JUnit ANT schema.

The advantage of this format is that the JUnit Ant schema is widely understood by most build servers and so can usually be consumed with no additional work.

The disadvantage is that this schema was designed to correspond to how JUnit works - and there is a significant mismatch with how Catch works. Additionally the format is not streamable (because opening elements hold counts of failed and passing tests as attributes) - so the whole test run must complete before it can be written.

## Other reporters
Other reporters are not part of the single-header distribution and need to be downloaded and included separately. All reporters are stored in `include/reporters` directory in the git repository, and are named `catch_reporter_*.hpp`. For example, to use the TeamCity reporter you need to download `include/reporters/catch_reporter_teamcity.hpp` and include it after Catch itself.

```
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include "catch_reporter_teamcity.hpp"
```

### TeamCity Reporter
```-r teamcity```

The TeamCity Reporter writes TeamCity service messages to stdout. In order to be able to use this reporter an additional header must also be included.

Being specific to TeamCity this is the best reporter to use with it - but it is completely unsuitable for any other purpose. It is a streaming format (it writes as it goes) - although test results don't appear in the TeamCity interface until the completion of a suite (usually the whole test run).

### Automake Reporter
```-r automake```

The Automake Reporter writes out the [meta tags](https://www.gnu.org/software/automake/manual/html_node/Log-files-generation-and-test-results-recording.html#Log-files-generation-and-test-results-recording) expected by automake via `make check`.

### TAP (Test Anything Protocol) Reporter
```-r tap```

Because of the incremental nature of Catch's test suites and ability to run specific tests, our implementation of TAP reporter writes out the number of tests in a suite last.

# Low-level tools

## CMake

You can use the following CMake script to automatically fetch Catch from github and configure it as an external project:

```CMake
cmake_minimum_required(VERSION 2.8.8)
project(catch_builder CXX)
include(ExternalProject)
find_package(Git REQUIRED)

ExternalProject_Add(
catch
PREFIX ${CMAKE_BINARY_DIR}/catch
GIT_REPOSITORY https://github.com/philsquared/Catch.git
TIMEOUT 10
UPDATE_COMMAND ${GIT_EXECUTABLE} pull
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
LOG_DOWNLOAD ON
)

# Expose required variable (CATCH_INCLUDE_DIR) to parent scope
ExternalProject_Get_Property(catch source_dir)
set(CATCH_INCLUDE_DIR ${source_dir}/single_include CACHE INTERNAL "Path to include folder for Catch")
```

If you put it in, e.g., `${PROJECT_SRC_DIR}/${EXT_PROJECTS_DIR}/catch/`, you can use it in your project by adding the following to your root CMake file:

```CMake
# Includes Catch in the project:
add_subdirectory(${EXT_PROJECTS_DIR}/catch)
include_directories(${CATCH_INCLUDE_DIR} ${COMMON_INCLUDES})
enable_testing(true) # Enables unit-testing.
```

---

[Home](Readme.md)

+ 0
- 277
libraries/Lora_Serialization/test/lib/Catch/docs/command-line.md View File

@@ -1,277 +0,0 @@
Catch works quite nicely without any command line options at all - but for those times when you want greater control the following options are available.
Click one of the followings links to take you straight to that option - or scroll on to browse the available options.

<a href="#specifying-which-tests-to-run"> ` <test-spec> ...`</a><br />
<a href="#usage"> ` -h, -?, --help`</a><br />
<a href="#listing-available-tests-tags-or-reporters"> ` -l, --list-tests`</a><br />
<a href="#listing-available-tests-tags-or-reporters"> ` -t, --list-tags`</a><br />
<a href="#showing-results-for-successful-tests"> ` -s, --success`</a><br />
<a href="#breaking-into-the-debugger"> ` -b, --break`</a><br />
<a href="#eliding-assertions-expected-to-throw"> ` -e, --nothrow`</a><br />
<a href="#invisibles"> ` -i, --invisibles`</a><br />
<a href="#sending-output-to-a-file"> ` -o, --out`</a><br />
<a href="#choosing-a-reporter-to-use"> ` -r, --reporter`</a><br />
<a href="#naming-a-test-run"> ` -n, --name`</a><br />
<a href="#aborting-after-a-certain-number-of-failures"> ` -a, --abort`</a><br />
<a href="#aborting-after-a-certain-number-of-failures"> ` -x, --abortx`</a><br />
<a href="#warnings"> ` -w, --warn`</a><br />
<a href="#reporting-timings"> ` -d, --durations`</a><br />
<a href="#input-file"> ` -f, --input-file`</a><br />
<a href="#run-section"> ` -c, --section`</a><br />
<a href="#filenames-as-tags"> ` -#, --filenames-as-tags`</a><br />


</br>

<a href="#list-test-names-only"> ` --list-test-names-only`</a><br />
<a href="#listing-available-tests-tags-or-reporters"> ` --list-reporters`</a><br />
<a href="#order"> ` --order`</a><br />
<a href="#rng-seed"> ` --rng-seed`</a><br />

</br>



<a id="specifying-which-tests-to-run"></a>
## Specifying which tests to run

<pre>&lt;test-spec> ...</pre>

Test cases, wildcarded test cases, tags and tag expressions are all passed directly as arguments. Tags are distinguished by being enclosed in square brackets.

If no test specs are supplied then all test cases, except "hidden" tests, are run.
A test is hidden by giving it any tag starting with (or just) a period (```.```) - or, in the deprecated case, tagged ```[hide]``` or given name starting with `'./'`. To specify hidden tests from the command line ```[.]``` or ```[hide]``` can be used *regardless of how they were declared*.

Specs must be enclosed in quotes if they contain spaces. If they do not contain spaces the quotes are optional.

Wildcards consist of the `*` character at the beginning and/or end of test case names and can substitute for any number of any characters (including none).

Test specs are case insensitive.

If a spec is prefixed with `exclude:` or the `~` character then the pattern matches an exclusion. This means that tests matching the pattern are excluded from the set - even if a prior inclusion spec included them. Subsequent inclusion specs will take precendence, however.
Inclusions and exclusions are evaluated in left-to-right order.

Test case examples:

<pre>thisTestOnly Matches the test case called, 'thisTestOnly'
"this test only" Matches the test case called, 'this test only'
these* Matches all cases starting with 'these'
exclude:notThis Matches all tests except, 'notThis'
~notThis Matches all tests except, 'notThis'
~*private* Matches all tests except those that contain 'private'
a* ~ab* abc Matches all tests that start with 'a', except those that
start with 'ab', except 'abc', which is included
</pre>

Names within square brackets are interpreted as tags.
A series of tags form an AND expression wheras a comma-separated sequence forms an OR expression. e.g.:

<pre>[one][two],[three]</pre>
This matches all tests tagged `[one]` and `[two]`, as well as all tests tagged `[three]`

Test names containing special characters, such as `,` or `[` can specify them on the command line using `\`.
`\` also escapes itself.

<a id="choosing-a-reporter-to-use"></a>
## Choosing a reporter to use

<pre>-r, --reporter &lt;reporter></pre>

A reporter is an object that formats and structures the output of running tests, and potentially summarises the results. By default a console reporter is used that writes, IDE friendly, textual output. Catch comes bundled with some alternative reporters, but more can be added in client code.<br />
The bundled reporters are:

<pre>-r console
-r compact
-r xml
-r junit
</pre>

The JUnit reporter is an xml format that follows the structure of the JUnit XML Report ANT task, as consumed by a number of third-party tools, including Continuous Integration servers such as Hudson. If not otherwise needed, the standard XML reporter is preferred as this is a streaming reporter, whereas the Junit reporter needs to hold all its results until the end so it can write the overall results into attributes of the root node.

<a id="breaking-into-the-debugger"></a>
## Breaking into the debugger
<pre>-b, --break</pre>

In some IDEs (currently XCode and Visual Studio) it is possible for Catch to break into the debugger on a test failure. This can be very helpful during debug sessions - especially when there is more than one path through a particular test.

<a id="showing-results-for-successful-tests"></a>
## Showing results for successful tests
<pre>-s, --success</pre>

Usually you only want to see reporting for failed tests. Sometimes it's useful to see *all* the output (especially when you don't trust that that test you just added worked first time!).
To see successful, as well as failing, test results just pass this option. Note that each reporter may treat this option differently. The Junit reporter, for example, logs all results regardless.

<a id="aborting-after-a-certain-number-of-failures"></a>
## Aborting after a certain number of failures
<pre>-a, --abort
-x, --abortx [&lt;failure threshold>]
</pre>

If a ```REQUIRE``` assertion fails the test case aborts, but subsequent test cases are still run.
If a ```CHECK``` assertion fails even the current test case is not aborted.

Sometimes this results in a flood of failure messages and you'd rather just see the first few. Specifying ```-a``` or ```--abort``` on its own will abort the whole test run on the first failed assertion of any kind. Use ```-x``` or ```--abortx``` followed by a number to abort after that number of assertion failures.

<a id="listing-available-tests-tags-or-reporters"></a>
## Listing available tests, tags or reporters
<pre>-l, --list-tests
-t, --list-tags
--list-reporters
</pre>

```-l``` or ```--list-tests``` will list all registered tests, along with any tags.
If one or more test-specs have been supplied too then only the matching tests will be listed.

```-t``` or ```--list-tags``` lists all available tags, along with the number of test cases they match. Again, supplying test specs limits the tags that match.

```--list-reporters``` lists the available reporters.

<a id="sending-output-to-a-file"></a>
## Sending output to a file
<pre>-o, --out &lt;filename>
</pre>

Use this option to send all output to a file. By default output is sent to stdout (note that uses of stdout and stderr *from within test cases* are redirected and included in the report - so even stderr will effectively end up on stdout).

<a id="naming-a-test-run"></a>
## Naming a test run
<pre>-n, --name &lt;name for test run></pre>

If a name is supplied it will be used by the reporter to provide an overall name for the test run. This can be useful if you are sending to a file, for example, and need to distinguish different test runs - either from different Catch executables or runs of the same executable with different options. If not supplied the name is defaulted to the name of the executable.

<a id="eliding-assertions-expected-to-throw"></a>
## Eliding assertions expected to throw
<pre>-e, --nothrow</pre>

Skips all assertions that test that an exception is thrown, e.g. ```REQUIRE_THROWS```.

These can be a nuisance in certain debugging environments that may break when exceptions are thrown (while this is usually optional for handled exceptions, it can be useful to have enabled if you are trying to track down something unexpected).

Sometimes exceptions are expected outside of one of the assertions that tests for them (perhaps thrown and caught within the code-under-test). The whole test case can be skipped when using ```-e``` by marking it with the ```[!throws]``` tag.

When running with this option any throw checking assertions are skipped so as not to contribute additional noise. Be careful if this affects the behaviour of subsequent tests.

<a id="invisibles"></a>
## Make whitespace visible
<pre>-i, --invisibles</pre>

If a string comparison fails due to differences in whitespace - especially leading or trailing whitespace - it can be hard to see what's going on.
This option transforms tabs and newline characters into ```\t``` and ```\n``` respectively when printing.

<a id="warnings"></a>
## Warnings
<pre>-w, --warn &lt;warning name></pre>

Enables reporting of warnings (only one, at time of this writing). If a warning is issued it fails the test.

The ony available warning, presently, is ```NoAssertions```. This warning fails a test case, or (leaf) section if no assertions (```REQUIRE```/ ```CHECK``` etc) are encountered.

<a id="reporting-timings"></a>
## Reporting timings
<pre>-d, --durations &lt;yes/no></pre>

When set to ```yes``` Catch will report the duration of each test case, in milliseconds. Note that it does this regardless of whether a test case passes or fails. Note, also, the certain reporters (e.g. Junit) always report test case durations regardless of this option being set or not.

<a id="input-file"></a>
## Load test names to run from a file
<pre>-f, --input-file &lt;filename></pre>

Provide the name of a file that contains a list of test case names - one per line. Blank lines are skipped and anything after the comment character, ```#```, is ignored.

A useful way to generate an initial instance of this file is to use the <a href="#list-test-names-only">list-test-names-only</a> option. This can then be manually curated to specify a specific subset of tests - or in a specific order.

<a id="list-test-names-only"></a>
## Just test names
<pre>--list-test-names-only</pre>

This option lists all available tests in a non-indented form, one on each line. This makes it ideal for saving to a file and feeding back into the <a href="#input-file">```-f``` or ```--input-file```</a> option.


<a id="order"></a>
## Specify the order test cases are run
<pre>--order &lt;decl|lex|rand&gt;</pre>

Test cases are ordered one of three ways:


### decl
Declaration order. The order the tests were originally declared in. Note that ordering between files is not guaranteed and is implementation dependent.

### lex
Lexicographically sorted. Tests are sorted, alpha-numerically, by name.

### rand
Randomly sorted. Test names are sorted using ```std::random_shuffle()```. By default the random number generator is seeded with 0 - and so the order is repeatable. To control the random seed see <a href="#rng-seed">rng-seed</a>.

<a id="rng-seed"></a>
## Specify a seed for the Random Number Generator
<pre>--rng-seed &lt;'time'|number&gt;</pre>

Sets a seed for the random number generator using ```std::srand()```.
If a number is provided this is used directly as the seed so the random pattern is repeatable.
Alternatively if the keyword ```time``` is provided then the result of calling ```std::time(0)``` is used and so the pattern becomes unpredictable.

In either case the actual value for the seed is printed as part of Catch's output so if an issue is discovered that is sensitive to test ordering the ordering can be reproduced - even if it was originally seeded from ```std::time(0)```.

<a id="usage"></a>
## Usage
<pre>-h, -?, --help</pre>

Prints the command line arguments to stdout


<a id="run-section"></a>
## Specify the section to run
<pre>-c, --section &lt;section name&gt;</pre>

To limit execution to a specific section within a test case, use this option one or more times.
To narrow to sub-sections use multiple instances, where each subsequent instance specifies a deeper nesting level.

E.g. if you have:

<pre>
TEST_CASE( "Test" ) {
SECTION( "sa" ) {
SECTION( "sb" ) {
/*...*/
}
SECTION( "sc" ) {
/*...*/
}
}
SECTION( "sd" ) {
/*...*/
}
}
</pre>

Then you can run `sb` with:
<pre>./MyExe Test -c sa -c sb</pre>

Or run just `sd` with:
<pre>./MyExe Test -c sd</pre>

To run all of `sa`, including `sb` and `sc` use:
<pre>./MyExe Test -c sa</pre>

There are some limitations of this feature to be aware of:
- Code outside of sections being skipped will still be executed - e.g. any set-up code in the TEST_CASE before the
start of the first section.</br>
- At time of writing, wildcards are not supported in section names.
- If you specify a section without narrowing to a test case first then all test cases will be executed
(but only matching sections within them).


<a id="filenames-as-tags"></a>
## Filenames as tags
<pre>-#, --filenames-as-tags</pre>

When this option is used then every test is given an additional tag which is formed of the unqualified
filename it is found in, with any extension stripped, prefixed with the `#` character.

So, for example, tests within the file `~\Dev\MyProject\Ferrets.cpp` would be tagged `[#Ferrets]`.


---

[Home](Readme.md)

+ 0
- 12
libraries/Lora_Serialization/test/lib/Catch/docs/commercial-users.md View File

@@ -1,12 +0,0 @@
# Commercial users of Catch

As well as [Open Source](opensource-users.md) users Catch is widely used within proprietary code bases too. Many companies like to keep this
information internal, and that's fine, but if you're more open it would be great if we could list the names of as
many organisations as possible that use Catch somewhere in their codebase. Enterprise environments often tend to be
far more conservative in their tool adoption - and being aware that other companies are using Catch can ease the
path in.

So if you are aware of Catch usage in your organisation, and are fairly confident there is no issue with sharing this
fact then please let us know - either directly, via a PR or [issue](https://github.com/philsquared/Catch/issues), or on the [forums](https://groups.google.com/forum/?fromgroups#!forum/catch-forum).
- Bloomberg

+ 0
- 100
libraries/Lora_Serialization/test/lib/Catch/docs/configuration.md View File

@@ -1,100 +0,0 @@
Catch is designed to "just work" as much as possible. For most people the only configuration needed is telling Catch which source file should host all the implementation code (```CATCH_CONFIG_MAIN```).

Nonetheless there are still some occasions where finer control is needed. For these occasions Catch exposes a set of macros for configuring how it is built.

# main()/ implementation

CATCH_CONFIG_MAIN // Designates this as implementation file and defines main()
CATCH_CONFIG_RUNNER // Designates this as implementation file

Although Catch is header only it still, internally, maintains a distinction between interface headers and headers that contain implementation. Only one source file in your test project should compile the implementation headers and this is controlled through the use of one of these macros - one of these identifiers should be defined before including Catch in *exactly one implementation file in your project*.

# Prefixing Catch macros

CATCH_CONFIG_PREFIX_ALL

To keep test code clean and uncluttered Catch uses short macro names (e.g. ```TEST_CASE``` and ```REQUIRE```). Occasionally these may conflict with identifiers from platform headers or the system under test. In this case the above identifier can be defined. This will cause all the Catch user macros to be prefixed with ```CATCH_``` (e.g. ```CATCH_TEST_CASE``` and ```CATCH_REQUIRE```).


# Terminal colour

CATCH_CONFIG_COLOUR_NONE // completely disables all text colouring
CATCH_CONFIG_COLOUR_WINDOWS // forces the Win32 console API to be used
CATCH_CONFIG_COLOUR_ANSI // forces ANSI colour codes to be used

Yes, I am English, so I will continue to spell "colour" with a 'u'.

When sending output to the terminal, if it detects that it can, Catch will use colourised text. On Windows the Win32 API, ```SetConsoleTextAttribute```, is used. On POSIX systems ANSI colour escape codes are inserted into the stream.

For finer control you can define one of the above identifiers (these are mutually exclusive - but that is not checked so may behave unexpectedly if you mix them):

Note that when ANSI colour codes are used "unistd.h" must be includable - along with a definition of ```isatty()```

Typically you should place the ```#define``` before #including "catch.hpp" in your main source file - but if you prefer you can define it for your whole project by whatever your IDE or build system provides for you to do so.

# Console width

CATCH_CONFIG_CONSOLE_WIDTH = x // where x is a number

Catch formats output intended for the console to fit within a fixed number of characters. This is especially important as indentation is used extensively and uncontrolled line wraps break this.
By default a console width of 80 is assumed but this can be controlled by defining the above identifier to be a different value.

# stdout

CATCH_CONFIG_NOSTDOUT

Catch does not use ```std::cout``` and ```std::cerr``` directly but gets them from ```Catch::cout()``` and ```Catch::cerr()``` respectively. If the above identifier is defined these functions are left unimplemented and you must implement them yourself. Their signatures are:

std::ostream& cout();
std::ostream& cerr();

This can be useful on certain platforms that do not provide ```std::cout``` and ```std::cerr```, such as certain embedded systems.

# C++ conformance toggles

CATCH_CONFIG_CPP11_NULLPTR // nullptr is supported?
CATCH_CONFIG_CPP11_NOEXCEPT // noexcept is supported?
CATCH_CONFIG_CPP11_GENERATED_METHODS // delete and default keywords for methods
CATCH_CONFIG_CPP11_IS_ENUM // std::is_enum is supported?
CATCH_CONFIG_CPP11_TUPLE // std::tuple is supported
CATCH_CONFIG_VARIADIC_MACROS // Usually pre-C++11 compiler extensions are sufficient
CATCH_CONFIG_CPP11_LONG_LONG // generates overloads for the long long type
CATCH_CONFIG_CPP11_OVERRIDE // CATCH_OVERRIDE expands to override (for virtual function implementations)
CATCH_CONFIG_CPP11_UNIQUE_PTR // Use std::unique_ptr instead of std::auto_ptr
CATCH_CONFIG_CPP11_SHUFFLE // Use std::shuffle instead of std::random_shuffle
CATCH_CONFIG_CPP11_TYPE_TRAITS // Use std::enable_if and <type_traits>

Catch has some basic compiler detection that will attempt to select the appropriate mix of these macros. However being incomplete - and often without access to the respective compilers - this detection tends to be conservative.
So overriding control is given to the user. If a compiler supports a feature (and Catch does not already detect it) then one or more of these may be defined to enable it (or suppress it, in some cases). If you do do this please raise an issue, specifying your compiler version (ideally with an idea of how to detect it) and stating that it has such support.
You may also suppress any of these features by using the `_NO_` form, e.g. `CATCH_CONFIG_CPP11_NO_NULLPTR`.

All C++11 support can be disabled with `CATCH_CONFIG_NO_CPP11`

# Other toggles

CATCH_CONFIG_COUNTER // Use __COUNTER__ to generate unique names for test cases
CATCH_CONFIG_WINDOWS_SEH // Enable SEH handling on Windows
CATCH_CONFIG_FAST_COMPILE // Sacrifices some (extremely minor) features for compilation speed
CATCH_CONFIG_POSIX_SIGNALS // Enable handling POSIX signals
CATCH_CONFIG_WINDOWS_CRTDBG // Enable leak checking using Windows's CRT Debug Heap

Currently Catch enables `CATCH_CONFIG_WINDOWS_SEH` only when compiled with MSVC, because some versions of MinGW do not have the necessary Win32 API support.

At this moment, `CATCH_CONFIG_FAST_COMPILE` changes only the behaviour of the `-b` (`--break`) flag, making it break into debugger in a stack frame *below* the actual test, unlike the default behaviour, where the break into debugger occurs in the same stack frame as the actual test. `CATCH_CONFIG_FAST_COMPILE` has to be either defined, or not defined, in all translation units that are linked into single test binary, or the behaviour of setting `-b` flag will be unpredictable.

`CATCH_CONFIG_POSIX_SIGNALS` is on by default, except when Catch is compiled under `Cygwin`, where it is disabled by default (but can be force-enabled by defining `CATCH_CONFIG_POSIX_SIGNALS`).

`CATCH_CONFIG_WINDOWS_CRTDBG` is off by default. If enabled, Windows's CRT is used to check for memory leaks, and displays them after the tests finish running.

Just as with the C++11 conformance toggles, these toggles can be disabled by using `_NO_` form of the toggle, e.g. `CATCH_CONFIG_NO_WINDOWS_SEH`.

# Windows header clutter

On Windows Catch includes `windows.h`. To minimize global namespace clutter in the implementation file, it defines `NOMINMAX` and `WIN32_LEAN_AND_MEAN` before including it. You can control this behaviour via two macros:

CATCH_CONFIG_NO_NOMINMAX // Stops Catch from using NOMINMAX macro
CATCH_CONFIG_NO_WIN32_LEAN_AND_MEAN // Stops Catch from using WIN32_LEAN_AND_MEAN macro

---

[Home](Readme.md)

+ 0
- 41
libraries/Lora_Serialization/test/lib/Catch/docs/contributing.md View File

@@ -1,41 +0,0 @@
# Contributing to Catch

So you want to contribute something to Catch? That's great! Whether it's a bug fix, a new feature, support for
additional compilers - or just a fix to the documentation - all contributions are very welcome and very much appreciated.
Of course so are bug reports and other comments and questions.

If you are contributing to the code base there are a few simple guidelines to keep in mind. This also includes notes to
help you find your way around. As this is liable to drift out of date please raise an issue or, better still, a pull
request for this file, if you notice that.

## Branches

Ongoing development is currently on _master_. At some point an integration branch will be set-up and PRs should target
that - but for now it's all against master. You may see feature branches come and go from time to time, too.

## Directory structure

_Users_ of Catch primarily use the single header version. _Maintainers_ should work with the full source (which is still,
primarily, in headers). This can be found in the `include` folder. There are a set of test files, currently under
`projects/SelfTest`. The test app can be built via CMake from the `CMakeLists.txt` file in the root, or you can generate
project files for Visual Studio, XCode, and others (instructions in the `projects` folder). If you have access to CLion
that can work with the CMake file directly.

As well as the runtime test files you'll also see a `SurrogateCpps` directory under `projects/SelfTest`.
This contains a set of .cpp files that each `#include` a single header.
While these files are not essential to compilation they help to keep the implementation headers self-contained.
At time of writing this set is not complete but has reasonable coverage.
If you add additional headers please try to remember to add a surrogate cpp for it.

The other directories are `scripts` which contains a set of python scripts to help in testing Catch as well as
generating the single include, and `docs`, which contains the documentation as a set of markdown files.

__When submitting a pull request please do not include changes to the single include, or to the version number file
as these are managed by the scripts!__


*this document is still in-progress...*

---

[Home](Readme.md)

+ 0
- 99
libraries/Lora_Serialization/test/lib/Catch/docs/limitations.md View File

@@ -1,99 +0,0 @@
# Known limitations

Catch has some known limitations, that we are not planning to change. Some of these are caused by our desire to support C++98 compilers, some of these are caused by our desire to keep Catch crossplatform, some exist because their priority is seen as low compared to the development effort they would need and some other yet are compiler/runtime bugs.

## Features
This section outlines some missing features, what is their status and their possible workarounds.

### Thread safe assertions
Because threading support in standard C++98 is limited (well, non-existent), assertion macros in Catch are not thread safe. This does not mean that you cannot use threads inside Catch's test, but that only single thread can interact with Catch's assertions and other macros.

This means that this is ok
```cpp
std::vector<std::thread> threads;
std::atomic<int> cnt{ 0 };
for (int i = 0; i < 4; ++i) {
threads.emplace_back([&]() {
++cnt; ++cnt; ++cnt; ++cnt;
});
}
for (auto& t : threads) { t.join(); }
REQUIRE(cnt == 16);
```
because only one thread passes the `REQUIRE` macro and this is not
```cpp
std::vector<std::thread> threads;
std::atomic<int> cnt{ 0 };
for (int i = 0; i < 4; ++i) {
threads.emplace_back([&]() {
++cnt; ++cnt; ++cnt; ++cnt;
CHECK(cnt == 16);
});
}
for (auto& t : threads) { t.join(); }
REQUIRE(cnt == 16);
```