aboutsummaryrefslogtreecommitdiff
path: root/src/tests/myriad.cpp
blob: ee4eac4eb6b6be9e383bc51dd3ac5d63e74af2cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <bu/myriad.h>
#include <bu/myriadstream.h>
#include <bu/string.h>
#include <bu/sio.h>
#include <bu/file.h>

int main( int , char *[] )
{
    Bu::File fMyriad("test.myr", Bu::File::WriteNew|Bu::File::Read );
    Bu::Myriad m( fMyriad, 32 );

    Bu::MyriadStream ms = m.create( Bu::Myriad::ReadWrite );
    ms.setSize( 150 );
    ms.setPos( 145 );
    char stuff[10];
    int32_t iRead = ms.read( stuff, 10 );

    Bu::println("Tried to read 10, expect 5, got %1").arg( iRead );


    return 0;
}