1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-23 13:23:52 +00:00
openmw/stream/tests/audiere_client_test.cpp
Nicolay Korslund 69e8f9c9db Renamed several dirs, files and classes. NOT TESTED.
- renamed imp_client/ to clients/ and ditto for servers/
- renamed imp/ to servers/
- renamed stream/input.h to stream/stream.h
- renamed Stream::InputStream to Stream::Stream
- updated various tests and makefiles
- NOT TESTED YET
2009-12-28 15:55:04 +01:00

33 lines
838 B
C++

#include "dummy_input.cpp"
#include "../clients/audiere_file.h"
#include <audiere.h>
#include <iostream>
using namespace audiere;
using namespace std;
int main()
{
char str[12];
memset(str, 0, 12);
Stream *inp = new DummyInput();
FilePtr p(new AudiereFile(inp, true));
cout << "pos=" << p->tell() << endl;
p->read(str, 2);
cout << "2 bytes: " << str << endl;
cout << "pos=" << p->tell() << endl;
p->seek(4, File::BEGIN);
cout << "pos=" << p->tell() << endl;
p->read(str, 3);
cout << "3 bytes: " << str << endl;
p->seek(-1, File::CURRENT);
cout << "pos=" << p->tell() << endl;
p->seek(-4, File::END);
cout << "pos=" << p->tell() << endl;
p->read(str, 4);
cout << "last 4 bytes: " << str << endl;
p->seek(0, File::BEGIN);
p->read(str, 11);
cout << "entire stream: " << str << endl;
return 0;
}