diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-10-07 21:01:42 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-10-08 17:45:53 +0200 |
commit | e5f1bba213b8ca9c3b8138ba053da453852ffb87 (patch) | |
tree | 62e22a66cd2f034790e1401476349edbbe631837 /oox/qa/unit | |
parent | 6970e2bac2b64c50ce04565ef1daea12d8a1df9a (diff) |
add test for projkey generation
Change-Id: I42957abbdcf396830713d7ca4eb7539e6c110e11
Diffstat (limited to 'oox/qa/unit')
-rw-r--r-- | oox/qa/unit/vba_encryption.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/oox/qa/unit/vba_encryption.cxx b/oox/qa/unit/vba_encryption.cxx index 1c7fc02e5827..785c480fc3d5 100644 --- a/oox/qa/unit/vba_encryption.cxx +++ b/oox/qa/unit/vba_encryption.cxx @@ -25,6 +25,8 @@ public: void testSimple2(); + void testProjKey1(); + // avoid the BootstrapFixtureBase::setUp and tearDown virtual void setUp() SAL_OVERRIDE; virtual void tearDown() SAL_OVERRIDE; @@ -32,6 +34,7 @@ public: CPPUNIT_TEST_SUITE(TestVbaEncryption); // CPPUNIT_TEST(testSimple1); // CPPUNIT_TEST(testSimple2); + CPPUNIT_TEST(testProjKey1); CPPUNIT_TEST_SUITE_END(); private: @@ -48,7 +51,6 @@ void TestVbaEncryption::testSimple1() VBAEncryption aEncryption(pData, nLength, aEncryptedStream, &nSeed, nProjKey); aEncryption.write(); - } void TestVbaEncryption::testSimple2() @@ -73,6 +75,13 @@ void TestVbaEncryption::testSimple2() } } +void TestVbaEncryption::testProjKey1() +{ + OUString aProjectID("{917DED54-440B-4FD1-A5C1-74ACF261E600}"); + sal_uInt8 nProjKey = VBAEncryption::calculateProjKey(aProjectID); + CPPUNIT_ASSERT_EQUAL((int)0xdf, (int)nProjKey); +} + void TestVbaEncryption::setUp() { } |