File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 66
77\*******************************************************************/
88
9+ #include < fstream>
910#include < json/json_parser.h>
1011#include < testing-utils/catch.hpp>
1112#include < testing-utils/message.h>
13+ #include < util/tempfile.h>
1214
1315SCENARIO (" Loading JSON files" )
1416{
1517 GIVEN (" A invalid JSON file and a valid JSON file" )
1618 {
17- const std::string valid_json_path = " ./json/valid.json" ;
18- const std::string invalid_json_path = " ./json/invalid.json" ;
19+ temporary_filet valid_json_file (" cbmc_unit_json_parser_valid" , " .json" );
20+ temporary_filet invalid_json_file (" cbmc_unit_json_parser_invalid" , " .json" );
21+ const std::string valid_json_path = valid_json_file ();
22+ const std::string invalid_json_path = invalid_json_file ();
23+ {
24+ std::ofstream valid_json_out (valid_json_path);
25+ valid_json_out << " {\n "
26+ << " \" hello\" : \" world\"\n "
27+ << " }\n " ;
28+ }
29+ {
30+ std::ofstream invalid_json_out (invalid_json_path);
31+ invalid_json_out << " foo\n " ;
32+ }
1933
2034 WHEN (" Loading the invalid JSON file" )
2135 {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments