• R/O
  • SSH

libctools: Commit

This library contains code that extends and simplifies different operations
for C language based programs.


Commit MetaInfo

Revisiona7329a485d3d4c5c2166352a5b4b53dbc963bbff (tree)
Zeit2018-10-10 12:53:05
AutorSergey Gusarov
CommiterSergey Gusarov

Log Message

test_void_bytes: Fixed ms vc compilation

Ändern Zusammenfassung

Diff

diff -r 29cd76c425fd -r a7329a485d3d tests/src/test_void_bytes.c
--- a/tests/src/test_void_bytes.c Wed Oct 10 06:48:58 2018 +0300
+++ b/tests/src/test_void_bytes.c Wed Oct 10 06:53:05 2018 +0300
@@ -56,15 +56,16 @@
5656 const uint8_t kVoidBytes[] = {'O', 'C', 'T', 'A', 'T', 'O', 'K', ' '}; // Pure ascii message
5757 const size_t kVoidBytesSize = CT_ARRAY_SIZE(kVoidBytes);
5858 const size_t kNumberOfOctets = octetsBufferSize(kNumberOfVoidBits, kVoidBytesSize);
59- uint8_t octets[kNumberOfOctets];
60- char hexString[kNumberOfOctets * kNibblesInByte];
59+ uint8_t octets[50];
60+ const size_t kHexStringSize = kNumberOfOctets * kNibblesInByte;
61+ char hexString[50];
6162 const char kCorrectHexString[] = "CF2135487D2E41";
6263
6364 packVoidBytes(kVoidBytes, octets, kNumberOfVoidBits, kVoidBytesSize);
6465
65- arrayToHexString(octets, hexString, CT_ARRAY_SIZE(hexString));
66+ arrayToHexString(octets, hexString, kHexStringSize);
6667
67- TEST_ASSERT_TRUE(strncmp(kCorrectHexString, hexString, CT_ARRAY_SIZE(hexString)) == 0);
68+ TEST_ASSERT_TRUE(strncmp(kCorrectHexString, hexString, kHexStringSize) == 0);
6869 }
6970
7071 void testUpack(void)
@@ -74,7 +75,7 @@
7475 VoidByte voidBytes[CHAR_BIT];
7576 const size_t kVoidBytesSize = CT_ARRAY_SIZE(voidBytes);
7677 const size_t kNumberOfOctets = octetsBufferSize(kNumberOfVoidBits, kVoidBytesSize);
77- uint8_t octets[kNumberOfOctets];
78+ uint8_t octets[50];
7879 const char kCorrectVoidBytes[] = {'O', 'C', 'T', 'A', 'T', 'O', 'K', ' '}; // Pure ascii message
7980
8081 hexStringToArray(octets, kEncodedMessage, CT_STRLEN(kEncodedMessage));
Show on old repository browser