oscar64/autotest/opp_array.cpp

24 lines
311 B
C++

#include <opp/array.h>
#include <assert.h>
int main(void)
{
array<int, 10> a10;
array<int, 20> a20;
for(int i=0; i<10; i++)
a10[i] = i;
for(int i=0; i<20; i++)
a20[i] = i;
int s = 0;
for(int i=0; i<10; i++)
s += a10[i];
for(int i=10; i<20; i++)
s -= a20[i];
assert(s == -100);
return 0;
}