]> git.tdb.fi Git - libs/core.git/blob - tests/console/console.cpp
Add unit tests
[libs/core.git] / tests / console / console.cpp
1 #include <msp/io/console.h>
2 #include <msp/io/poll.h>
3 #include <msp/io/print.h>
4
5 using namespace Msp;
6
7 int main()
8 {
9         IO::cin.set_local_echo(false);
10         IO::cin.set_line_buffer(false);
11         while(1)
12         {
13                 if(IO::poll(IO::cin, IO::P_INPUT)==IO::P_INPUT)
14                 {
15                         char c = IO::cin.get();
16                         IO::print("Got character '%c' (%02X)\n", c, c);
17                 }
18                 else
19                 {
20                         IO::print("EOF\n");
21                         break;
22                 }
23         }
24
25         return 0;
26 }