| Directory: | ./ |
|---|---|
| File: | tests/traces/files.cpp |
| Date: | 2025-05-13 12:28:21 |
| Exec | Total | Coverage | |
|---|---|---|---|
| Lines: | 8 | 9 | 88.9% |
| Branches: | 8 | 18 | 44.4% |
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * Copyright 2010, | ||
| 3 | * François Bleibel, | ||
| 4 | * Olivier Stasse, | ||
| 5 | * | ||
| 6 | * CNRS/AIST | ||
| 7 | * | ||
| 8 | */ | ||
| 9 | |||
| 10 | #include <boost/filesystem/operations.hpp> | ||
| 11 | #include <boost/filesystem/path.hpp> | ||
| 12 | #include <iostream> | ||
| 13 | #include <sot/core/debug.hh> | ||
| 14 | |||
| 15 | using namespace std; | ||
| 16 | |||
| 17 | 1 | int main() { | |
| 18 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | boost::filesystem::create_directory("foobar"); |
| 19 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | ofstream file("foobar/cheeze"); |
| 20 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | file << "tastes good!\n"; |
| 21 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | file.close(); |
| 22 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 times.
|
1 | if (!boost::filesystem::exists("foobar/cheeze")) |
| 23 | ✗ | std::cout << "Something is rotten in foobar\n"; | |
| 24 | |||
| 25 | 1 | return 0; | |
| 26 | 1 | } | |
| 27 |