Browse Source

Intermittent check-in - more tests added (this is just wrapping them in the scaffold for now)

local_cpptest
Krista Bennett 4 years ago
parent
commit
43fb2b7b48
15 changed files with 342 additions and 181 deletions
  1. +2
    -1
      .hgignore
  2. +29
    -0
      test/include/AppleMailTests.h
  3. +21
    -0
      test/include/BloblistTests.h
  4. +19
    -0
      test/include/CaseAndDotAddressTests.h
  5. +20
    -0
      test/include/StringpairListTests.h
  6. +19
    -0
      test/include/TrustManipulationTests.h
  7. +19
    -0
      test/include/TrustwordsTests.h
  8. +19
    -0
      test/include/UserIDAliasTests.h
  9. +25
    -1
      test/src/SuiteMaker.cc
  10. +30
    -36
      test/src/engine_tests/BloblistTests.cc
  11. +22
    -26
      test/src/engine_tests/CaseAndDotAddressTests.cc
  12. +37
    -32
      test/src/engine_tests/StringpairListTests.cc
  13. +27
    -28
      test/src/engine_tests/TrustManipulationTests.cc
  14. +30
    -34
      test/src/engine_tests/TrustwordsTests.cc
  15. +23
    -23
      test/src/engine_tests/UserIDAliasTests.cc

+ 2
- 1
.hgignore View File

@ -61,4 +61,5 @@ trustdb.gpg
__pycache__
*.pyc
test/python_tests/test?
GNUMakefile
test/pEp_test_home
test/TestDriver

+ 29
- 0
test/include/AppleMailTests.h View File

@ -0,0 +1,29 @@
// This file is under GNU General Public License 3.0
// see LICENSE.txt
#ifndef APPLE_MAIL_TESTS_H
#define APPLE_MAIL_TESTS_H
#include <stdlib.h>
#include <string.h>
#include "platform.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <cpptest.h>
#include <cpptest-suite.h>
#include <cpptest-textoutput.h>
#include "mime.h"
#include "message_api.h"
#include "test_util.h"
using namespace std;
class AppleMailTests : public EngineTestIndividualSuite {
public:
AppleMailTests(string suitename, string test_home_dir);
private:
void check_apple_mail();
};
#endif

+ 21
- 0
test/include/BloblistTests.h View File

@ -0,0 +1,21 @@
// This file is under GNU General Public License 3.0
// see LICENSE.txt
#ifndef BLOBLIST_TESTS_H
#define BLOBLIST_TESTS_H
#include <string>
#include "EngineTestSuite.h"
using namespace std;
class BloblistTests : public EngineTestSuite {
public:
BloblistTests(string suitename, string test_home_dir);
private:
void check_bloblists();
bool test_blob_equals(size_t size1, char* blob1, size_t size2, char* blob2);
bool test_bloblist_node_equals(bloblist_t* val1, bloblist_t* val2);
};
#endif

+ 19
- 0
test/include/CaseAndDotAddressTests.h View File

@ -0,0 +1,19 @@
// This file is under GNU General Public License 3.0
// see LICENSE.txt
#ifndef CASE_AND_DOT_ADDRESS_TESTS_H
#define CASE_AND_DOT_ADDRESS_TESTS_H
#include <string>
#include "EngineTestIndividualSuite.h"
using namespace std;
class CaseAndDotAddressTests : public EngineTestIndividualSuite {
public:
CaseAndDotAddressTests(string suitename, string test_home_dir);
private:
void check_case_and_dot_address();
};
#endif

+ 20
- 0
test/include/StringpairListTests.h View File

@ -0,0 +1,20 @@
// This file is under GNU General Public License 3.0
// see LICENSE.txt
#ifndef STRINGPAIR_LIST_TESTS_H
#define STRINGPAIR_LIST_TESTS_H
#include <string>
#include "EngineTestSuite.h"
using namespace std;
class StringpairListTests : public EngineTestSuite {
public:
StringpairListTests(string suitename, string test_home_dir);
private:
void check_stringpair_lists();
bool test_stringpair_equals(stringpair_t* val1, stringpair_t* val2);
};
#endif

+ 19
- 0
test/include/TrustManipulationTests.h View File

@ -0,0 +1,19 @@
// This file is under GNU General Public License 3.0
// see LICENSE.txt
#ifndef TRUST_MANIPULATION_TESTS_H
#define TRUST_MANIPULATION_TESTS_H
#include <string>
#include "EngineTestIndividualSuite.h"
using namespace std;
class TrustManipulationTests : public EngineTestIndividualSuite {
public:
TrustManipulationTests(string suitename, string test_home_dir);
private:
void check_trust_manipulation();
};
#endif

+ 19
- 0
test/include/TrustwordsTests.h View File

@ -0,0 +1,19 @@
// This file is under GNU General Public License 3.0
// see LICENSE.txt
#ifndef TRUSTWORDS_TESTS_H
#define TRUSTWORDS_TESTS_H
#include <string>
#include "EngineTestIndividualSuite.h"
using namespace std;
class TrustwordsTests : public EngineTestIndividualSuite {
public:
TrustwordsTests(string suitename, string test_home_dir);
private:
void check_trustwords();
};
#endif

+ 19
- 0
test/include/UserIDAliasTests.h View File

@ -0,0 +1,19 @@
// This file is under GNU General Public License 3.0
// see LICENSE.txt
#ifndef USERID_ALIAS_TESTS_H
#define USERID_ALIAS_TESTS_H
#include <string>
#include "EngineTestIndividualSuite.h"
using namespace std;
class UserIDAliasTests : public EngineTestIndividualSuite {
public:
UserIDAliasTests(string suitename, string test_home_dir);
private:
void check_userid_aliases();
};
#endif

+ 25
- 1
test/src/SuiteMaker.cc View File

@ -14,21 +14,45 @@
// Begin where we generate stuff
#include "DecorateTests.h"
#include "AppleMailTests.h"
#include "CaseAndDotAddressTests.h"
#include "StringpairListTests.h"
#include "BloblistTests.h"
#include "TrustwordsTests.h"
#include "TrustManipulationTests.h"
#include "UserIDAliasTests.h"
const char* SuiteMaker::all_suites[] = {
"DecorateTests",
"AppleMailTests",
"CaseAndDotAddressTests",
"StringpairListTests",
"BloblistTests",
"TrustwordsTests",
"TrustManipulationTests",
"UserIDAliasTests",
};
// This file is generated, so magic constants are ok.
int SuiteMaker::num_suites = 2;
int SuiteMaker::num_suites = 8;
void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
if (strcmp(test_class_name, "DecorateTests") == 0)
*test_suite = new DecorateTests(test_class_name, test_home);
else if (strcmp(test_class_name, "AppleMailTests") == 0)
*test_suite = new AppleMailTests(test_class_name, test_home);
else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
*test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
else if (strcmp(test_class_name, "StringpairListTests") == 0)
*test_suite = new StringpairListTests(test_class_name, test_home);
else if (strcmp(test_class_name, "BloblistTests") == 0)
*test_suite = new BloblistTests(test_class_name, test_home);
else if (strcmp(test_class_name, "TrustwordsTests") == 0)
*test_suite = new TrustwordsTests(test_class_name, test_home);
else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
*test_suite = new TrustManipulationTests(test_class_name, test_home);
else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
*test_suite = new UserIDAliasTests(test_class_name, test_home);
}
void SuiteMaker::suitemaker_buildlist(const char** test_class_names, int num_to_run, const char* test_home, std::vector<Test::Suite*>& test_suites) {


test/bloblist_test.cc → test/src/engine_tests/BloblistTests.cc View File


test/case_and_dot_address_test.cc → test/src/engine_tests/CaseAndDotAddressTests.cc View File


test/stringpair_list_test.cc → test/src/engine_tests/StringpairListTests.cc View File


test/trust_manipulation_test.cc → test/src/engine_tests/TrustManipulationTests.cc View File


test/trustwords_test.cc → test/src/engine_tests/TrustwordsTests.cc View File


test/userid_alias_test.cc → test/src/engine_tests/UserIDAliasTests.cc View File


Loading…
Cancel
Save