Closed richelbilderbeek closed 7 years ago
Hm, thats weird, it works for me just as fine as the others. Anyways, thank you for the overall effort, it is of course very welcome :)
(attilaszia: no need to read this, this is a note for myself)
Found the cause:
bool Table::Init(std::string filename){
std::cout << "Initializing a table with " << filename << "\n";
std::ifstream f;
std::string line;
f.open(filename.c_str());
assert(f.is_open());
int lastindex = filename.find_last_of(".");
raw_filename_ = filename.substr(0, lastindex);
if ( f.is_open() ) {
if ( getline (f,line) ){
std::stringstream linestream(line);
// Setup width, and height
linestream >> width_;
linestream >> height_;
assert(height_ > 0);
assert(height_ < 1'000'000'000);
}
// Setup cols
for (int i=0; i<width_; i++){
getline (f,line);
std::vector<int> linedata;
std::stringstream linestream(line);
int value;
while ( linestream >> value ) {
linedata.push_back(value);
assert(linedata.size() < 1'000'000);
}
assert(height_ > 0);
assert(height_ < 1'000'000'000); //HERE
Line* current_col = new Line(linedata, height_);
current_col->set_type(kColumn);
current_col->j(i);
cols_.push_back( current_col );
heap_.push( current_col );
}
//...
}
Leading hypothesis:
Works now locally and on Travis, without any bug actually found. May be a Heisenbug. Close anyways.
Thanks for adding the examples!
Too bad, it gives a segfault:
In the
examples
folder:In the root folder:
I volunteer to fix it.
To do so, I will add Travis CI to my fork (I have some experience with it) to test if the examples do work. Feel free to remove the Travis status badge, but all you'll need to do to join in on the Good Practices, is register at https://travis-ci.org (it's free and two clicks if you use your GitHub account). Sure, I volunteer to maintain it.
Additionally, I will add a qmake project file called
nonogram.pro
. Sure, I volunteer to maintain it.I hope you agree on the extra goodies I'll give you for free. If not, let me know.