|
|
@@ -16,7 +16,7 @@ extern "C" {
|
|
|
}
|
|
|
|
|
|
TEST_GROUP(CipElectronicKey) {
|
|
|
- ElectronicKeyFormat4 *key = NULL;
|
|
|
+ ElectronicKeyFormat4 *key;
|
|
|
|
|
|
void setup() {
|
|
|
key = ElectronicKeyFormat4New();
|
|
|
@@ -29,7 +29,8 @@ TEST_GROUP(CipElectronicKey) {
|
|
|
};
|
|
|
|
|
|
TEST(CipElectronicKey, CreateElectronicKey) {
|
|
|
- char dummyArea[kElectronicKeyFormat4Size] = {0};
|
|
|
+ char dummyArea[kElectronicKeyFormat4Size];
|
|
|
+ memset(dummyArea, 0, sizeof(dummyArea));
|
|
|
MEMCMP_EQUAL(dummyArea, key, kElectronicKeyFormat4Size);
|
|
|
};
|
|
|
|
|
|
@@ -39,7 +40,8 @@ TEST(CipElectronicKey, DeleteElectronicKey) {
|
|
|
}
|
|
|
|
|
|
TEST(CipElectronicKey, SetVendorID) {
|
|
|
- char demoArea[kElectronicKeyFormat4Size] = {0};
|
|
|
+ char demoArea[kElectronicKeyFormat4Size];
|
|
|
+ memset(demoArea, 0, sizeof(demoArea));
|
|
|
CipUint *vendor_id = (CipUint *)demoArea;
|
|
|
*vendor_id = 1;
|
|
|
ElectronicKeyFormat4SetVendorId(1, key);
|
|
|
@@ -58,7 +60,8 @@ TEST(CipElectronicKey, GetVendorID) {
|
|
|
}
|
|
|
|
|
|
TEST(CipElectronicKey, SetDeviceType) {
|
|
|
- char demoArea[kElectronicKeyFormat4Size] = {0};
|
|
|
+ char demoArea[kElectronicKeyFormat4Size];
|
|
|
+ memset(demoArea, 0, sizeof(demoArea));
|
|
|
CipUint *device_type = (CipUint *)demoArea + 1;
|
|
|
*device_type = 1;
|
|
|
|
|
|
@@ -77,7 +80,8 @@ TEST(CipElectronicKey, GetDeviceType) {
|
|
|
}
|
|
|
|
|
|
TEST(CipElectronicKey, SetProductCode) {
|
|
|
- char demoArea[kElectronicKeyFormat4Size] = {0};
|
|
|
+ char demoArea[kElectronicKeyFormat4Size];
|
|
|
+ memset(demoArea, 0, sizeof(demoArea));
|
|
|
CipUint *product_code = (CipUint *)demoArea + 2;
|
|
|
*product_code = 1;
|
|
|
|
|
|
@@ -96,7 +100,8 @@ TEST(CipElectronicKey, GetProductCode) {
|
|
|
}
|
|
|
|
|
|
TEST(CipElectronicKey, SetMajorRevisionCompatibility) {
|
|
|
- char demoArea[kElectronicKeyFormat4Size] = {0};
|
|
|
+ char demoArea[kElectronicKeyFormat4Size];
|
|
|
+ memset(demoArea, 0, sizeof(demoArea));
|
|
|
CipByte *major_revision_compatiblitiy = (CipByte *)demoArea + 6;
|
|
|
*major_revision_compatiblitiy = 0x81;
|
|
|
|
|
|
@@ -126,7 +131,8 @@ TEST(CipElectronicKey, GetMajorRevisionCompatibility) {
|
|
|
}
|
|
|
|
|
|
TEST(CipElectronicKey, SetMinorRevision) {
|
|
|
- char demoArea[kElectronicKeyFormat4Size] = {0};
|
|
|
+ char demoArea[kElectronicKeyFormat4Size];
|
|
|
+ memset(demoArea, 0, sizeof(demoArea));
|
|
|
CipByte *minor_revision_compatiblitiy = (CipByte *)demoArea + 7;
|
|
|
*minor_revision_compatiblitiy = 0x81;
|
|
|
|