SystemC-Components-Test/tests/io-redirector/main.cpp

23 lines
546 B
C++
Raw Normal View History

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