Skip to content

Commit

Permalink
ci: test flush
Browse files Browse the repository at this point in the history
  • Loading branch information
surovic committed Jan 6, 2023
1 parent f3883e2 commit 25cc456
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tests/test_simple_union.cpp
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
#include <fstream>
#include <iostream>
#include <ostream>
#include <string>

void union_bytes(std::string &json) {
std::cout << "union_bytes 1" << std::endl;
std::cout << "union_bytes 1" << std::endl << std::flush;
if (json[0] == json[1]) {
printf("matching!\n");
} else {
printf("not matching!\n");
}
std::cout << "union_bytes 2" << std::endl;
std::cout << "union_bytes 2" << std::endl << std::flush;
}

int main(int argc, const char *argv[]) {
std::cout << "main 1" << std::endl;
std::cout << "main 1" << std::endl << std::flush;
if (argc < 2) {
std::cout << "Error! no file supplied!" << std::endl;
std::cout << "Error! no file supplied!" << std::endl << std::flush;
return -1;
}
std::ifstream myfile;
std::cout << "main 2" << std::endl;
std::cout << "main 2" << std::endl << std::flush;
myfile.open(argv[1]);
std::cout << "main 3" << std::endl;
std::cout << "main 3" << std::endl << std::flush;
std::string line;
std::string json;
std::cout << "main 4" << std::endl;
std::cout << "main 4" << std::endl << std::flush;
if (myfile.is_open()) {
while (getline(myfile, line)) {
json += line + '\n';
}
union_bytes(json);
} else {
std::cout << "FAILED TO OPEN DATA" << std::endl;
std::cout << "FAILED TO OPEN DATA" << std::endl << std::flush;
return -1;
}
std::cout << "main 5" << std::endl;
return 0;
std::cout << "main 5" << std::endl << std::flush;
return -1;
}

0 comments on commit 25cc456

Please sign in to comment.