#include <stdlib.h>
#include <assert.h>
#include <iostream>
#include "bm.h"
#include "bmbvimport.h"
#include "bmundef.h"
using namespace std;
int main(void)
{
try
{
bm::bvector<> bv;
unsigned int arr[2058] = {0, };
arr[0] = 1 << 16;
arr[2047] = 1u << 31;
arr[2048] = 1u << 7;
bm::bit_import_u32(bv, arr, sizeof(arr)/sizeof(arr[0]), true);
auto cnt = bv.count();
cout << "Imported " << cnt << " bits." << endl;
assert(cnt == 3);
assert(bv.test(16));
assert(bv.test(65535));
assert(bv.test(65536 + 7));
}
catch(std::exception& ex)
{
std::cerr << ex.what() << std::endl;
return 1;
}
return 0;
}