MCPcopy Create free account
hub / github.com/d99kris/rapidcsv / main

Function main

tests/test034.cpp:6–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include "unittest.h"
5
6int main()
7{
8 int rv = 0;
9
10 std::string csv =
11 "-,A,B,C\n"
12 "1,3,9,81\n"
13 "2,4,16,256\n"
14 ;
15
16 std::string path = unittest::TempPath();
17 unittest::WriteFile(path, csv);
18
19 std::string pathcopy = unittest::TempPath();
20
21 try
22 {
23 rapidcsv::Document doc(path, rapidcsv::LabelParams(0, 0));
24
25 rapidcsv::Document doccopy(doc);
26
27 doccopy.Save(pathcopy);
28
29 std::string csvread = unittest::ReadFile(pathcopy);
30
31 unittest::ExpectEqual(std::string, csv, csvread);
32 }
33 catch (const std::exception& ex)
34 {
35 std::cout << "exception: " << ex.what() << std::endl;
36 rv = 1;
37 }
38
39 unittest::DeleteFile(path);
40 unittest::DeleteFile(pathcopy);
41
42 return rv;
43}

Callers

nothing calls this directly

Calls 7

TempPathFunction · 0.85
WriteFileFunction · 0.85
LabelParamsClass · 0.85
ReadFileFunction · 0.85
DeleteFileFunction · 0.85
SaveMethod · 0.80
whatMethod · 0.80

Tested by

no test coverage detected