2020-04-23 16:02:12 +02:00
|
|
|
/*
|
|
|
|
* main.cpp
|
|
|
|
*
|
|
|
|
* Created on: 01.01.2019
|
|
|
|
* Author: eyck
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <cassert>
|
2023-12-22 22:13:38 +01:00
|
|
|
#include <cstdio>
|
|
|
|
#include <iostream>
|
|
|
|
#include <util/io-redirector.h>
|
2020-04-23 16:02:12 +02:00
|
|
|
|
2022-08-23 08:56:05 +02:00
|
|
|
using namespace util;
|
|
|
|
|
2023-12-22 22:13:38 +01:00
|
|
|
int main(int arcg, char* argv[]) {
|
2020-04-23 16:02:12 +02:00
|
|
|
IoRedirector::get().start();
|
|
|
|
auto result1 = IoRedirector::get().get_output();
|
2023-12-22 22:13:38 +01:00
|
|
|
assert(result1 == "");
|
2020-04-23 16:02:12 +02:00
|
|
|
printf("Some output");
|
2023-12-22 22:13:38 +01:00
|
|
|
std::cout << "Some other output" << std::endl;
|
2020-04-23 16:02:12 +02:00
|
|
|
auto result2 = IoRedirector::get().get_output();
|
2023-12-22 22:13:38 +01:00
|
|
|
assert(result2 == "Some outputSome other output\n");
|
2020-04-23 16:02:12 +02:00
|
|
|
IoRedirector::get().stop();
|
|
|
|
}
|