MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / SetUpTestSuite

Method SetUpTestSuite

lib/mdflib/mdflib_test/src/testwrite3.cpp:40–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38namespace mdf::test {
39
40void TestWrite3::SetUpTestSuite() {
41 MdfLogStream::SetLogFunction1(LogToConsole);
42
43 try {
44 // Create the root asn log directory. Note that this directory
45 // exists in the temp dir of the operating system and is not
46 // deleted by this test program. May be deleted at restart
47 // of the operating system.
48 auto temp_dir = temp_directory_path();
49 temp_dir.append("test");
50 temp_dir.append("mdf");
51 temp_dir.append("write3");
52 kTestDir = temp_dir.string();
53 // Create the test directory. Note that this directory is deleted before
54 // running the test, not after.
55 std::error_code err;
56 remove_all(temp_dir, err);
57 create_directories(temp_dir);
58
59 MDF_TRACE() << "Created the test directory. Dir: " << kTestDir;
60 kSkipTest = false;
61
62 } catch (const std::exception& err) {
63 MDF_ERROR() << "Failed to create the test directories. Error: "
64 << err.what();
65 kSkipTest = true;
66 }
67
68}
69
70void TestWrite3::TearDownTestSuite() {
71 MdfLogStream::SetLogFunction1(nullptr);

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected