Left: | ||
Right: |
OLD | NEW |
---|---|
1 #include "nspr.h" | 1 #include "nspr.h" |
2 #include "nss.h" | 2 #include "nss.h" |
3 #include "ssl.h" | 3 #include "ssl.h" |
4 | 4 |
5 #include <cstdlib> | 5 #include <cstdlib> |
6 | 6 |
7 #include "test_io.h" | |
8 | |
9 #define GTEST_HAS_RTTI 0 | 7 #define GTEST_HAS_RTTI 0 |
10 #include "gtest/gtest.h" | 8 #include "gtest/gtest.h" |
11 | 9 |
12 std::string g_working_dir_path; | 10 std::string g_working_dir_path; |
13 | 11 |
14 int main(int argc, char **argv) { | 12 int main(int argc, char **argv) { |
15 // Start the tests | 13 // Start the tests |
16 ::testing::InitGoogleTest(&argc, argv); | 14 ::testing::InitGoogleTest(&argc, argv); |
17 g_working_dir_path = "."; | 15 g_working_dir_path = "."; |
18 | 16 |
19 char* workdir = getenv("NSS_GTEST_WORKDIR"); | 17 char* workdir = getenv("NSS_GTEST_WORKDIR"); |
20 if (workdir) | 18 if (workdir) |
21 g_working_dir_path = workdir; | 19 g_working_dir_path = workdir; |
ekr-rietveld
2015/11/06 21:31:58
The working directory isn't needed.
| |
22 | 20 |
23 for (int i = 0; i < argc; i++) { | 21 for (int i = 0; i < argc; i++) { |
24 if (!strcmp(argv[i], "-d")) { | 22 if (!strcmp(argv[i], "-d")) { |
25 g_working_dir_path = argv[i + 1]; | 23 g_working_dir_path = argv[i + 1]; |
26 ++i; | 24 ++i; |
27 } | 25 } |
28 } | 26 } |
29 | 27 |
30 NSS_Initialize(g_working_dir_path.c_str(), "", "", SECMOD_DB, NSS_INIT_READONL Y); | 28 NSS_NoDB_Init(g_working_dir_path.c_str()); |
ekr-rietveld
2015/11/06 21:31:58
You can pass NULL here.
| |
31 NSS_SetDomesticPolicy(); | 29 NSS_SetDomesticPolicy(); |
32 int rv = RUN_ALL_TESTS(); | 30 int rv = RUN_ALL_TESTS(); |
33 | 31 |
34 NSS_Shutdown(); | 32 NSS_Shutdown(); |
35 | 33 |
36 nss_test::Poller::Shutdown(); | |
37 | |
38 return rv; | 34 return rv; |
39 } | 35 } |
OLD | NEW |