George Edwards
George Edwards

Reputation: 9229

Feeding C++ code set values during debug

I am debugging some code in Visual Studio. At the moment I am using:

cin << value1 << cin << value2;
// process these values
cout << "New Values Are: " << value3 << value4 << endl;

However, to test the algorithm I am using an ever greater number of inputs and wondered if there was a way, either in the tool chain, or in the code, to automate putting these initial values in? What is the standard way to automate this. If possible, I would quite like to avoid setting up a matrix and then reading off it line by line, as I want to keep the test as close to the real scenario as possible, without introducing much extra code - if any.

Upvotes: 0

Views: 34

Answers (1)

Vlad Feinstein
Vlad Feinstein

Reputation: 11321

I suggest instead of automating your input, automate the test. For example, by using Google Test framework (gtest).

Upvotes: 1

Related Questions