4109
4174
assert(pos.second == 3);
4112
void mtv_perf_test_block_position_lookup()
4117
// Default insertion which always looks up the right element block
4118
// from the position of the first block. As such, as the block size
4119
// grows, so does the time it takes to search for the right block.
4124
stack_printer __stack_printer__("::mtv_perf_test_block_position_lookup::default insertion");
4125
for (size_t i = 0; i < n; ++i)
4127
size_t pos1 = i*2, pos2 = i*2 + 1;
4134
// As a solution for this, we can use an iterator to specify the start
4135
// position, which eliminates the above scalability problem nicely.
4138
mtv_type::iterator pos_hint = db.begin();
4141
stack_printer __stack_printer__("::mtv_perf_test_block_position_lookup::insertion with position hint");
4142
for (size_t i = 0; i < n; ++i)
4144
size_t pos1 = i*2, pos2 = i*2 + 1;
4145
pos_hint = db.set(pos_hint, pos1, val1);
4146
pos_hint = db.set(pos_hint, pos2, val2);
4177
void mtv_test_next_position()
4179
stack_printer __stack_printer__("::mtv_test_next_position");
4183
db.set(4, string("A"));
4184
db.set(5, string("B"));
4185
db.set(6, string("C"));
4187
mtv_type::position_type pos = db.position(0);
4188
assert(mtv_type::logical_position(pos) == 0);
4189
assert(pos.first->type == mtv::element_type_empty);
4191
pos = mtv_type::next_position(pos);
4192
assert(mtv_type::logical_position(pos) == 1);
4193
assert(pos.first->type == mtv::element_type_empty);
4195
pos = mtv_type::next_position(pos);
4196
assert(mtv_type::logical_position(pos) == 2);
4197
assert(pos.first->type == mtv::element_type_numeric);
4198
assert(mtv_type::get<mtv::numeric_element_block>(pos) == 1.1);
4200
pos = mtv_type::next_position(pos);
4201
assert(mtv_type::logical_position(pos) == 3);
4202
assert(pos.first->type == mtv::element_type_numeric);
4203
assert(mtv_type::get<mtv::numeric_element_block>(pos) == 1.2);
4205
pos = mtv_type::next_position(pos);
4206
assert(mtv_type::logical_position(pos) == 4);
4207
assert(pos.first->type == mtv::element_type_string);
4208
assert(mtv_type::get<mtv::string_element_block>(pos) == "A");
4210
pos = mtv_type::next_position(pos);
4211
assert(mtv_type::logical_position(pos) == 5);
4212
assert(pos.first->type == mtv::element_type_string);
4213
assert(mtv_type::get<mtv::string_element_block>(pos) == "B");
4215
pos = mtv_type::next_position(pos);
4216
assert(mtv_type::logical_position(pos) == 6);
4217
assert(pos.first->type == mtv::element_type_string);
4218
assert(mtv_type::get<mtv::string_element_block>(pos) == "C");
4220
pos = mtv_type::next_position(pos);
4221
assert(mtv_type::logical_position(pos) == 7);
4222
assert(pos.first->type == mtv::element_type_empty);
4224
pos = mtv_type::next_position(pos);
4225
assert(mtv_type::logical_position(pos) == 8);
4226
assert(pos.first->type == mtv::element_type_empty);
4228
pos = mtv_type::next_position(pos);
4229
assert(mtv_type::logical_position(pos) == 9);
4230
assert(pos.first->type == mtv::element_type_empty);
4232
pos = mtv_type::next_position(pos);
4233
assert(pos.first == db.end());
4236
void mtv_test_swap_range()
4238
stack_printer __stack_printer__("::mtv_test_swap_range");
4239
mtv_type db1(10), db2(10);
4248
db1.swap(2, 4, db2, 2);
4249
assert(db1.get<double>(2) == 2.1);
4250
assert(db1.get<double>(3) == 2.2);
4251
assert(db1.get<double>(4) == 2.3);
4252
assert(db2.get<double>(2) == 1.1);
4253
assert(db2.get<double>(3) == 1.2);
4254
assert(db2.get<double>(4) == 1.3);
4256
// Source is empty but destination is not.
4258
db2 = mtv_type(3, 12.3);
4259
db1.swap(1, 2, db2, 1);
4260
assert(db1.is_empty(0));
4261
assert(db1.get<double>(1) == 12.3);
4262
assert(db1.get<double>(2) == 12.3);
4263
assert(db1.block_size() == 2);
4264
assert(db2.get<double>(0) == 12.3);
4265
assert(db2.is_empty(1));
4266
assert(db2.is_empty(2));
4267
assert(db2.block_size() == 2);
4269
// Go to the opposite direction.
4270
db1.swap(1, 2, db2, 1);
4271
assert(db1.block_size() == 1);
4272
mtv_type::iterator it = db1.begin();
4273
assert(it->type == mtv::element_type_empty);
4274
assert(it->size == 3);
4276
assert(it->type == mtv::element_type_numeric);
4277
assert(it->size == 3);
4280
short short_val = 5;
4281
db1 = mtv_type(5, int_val);
4282
db2 = mtv_type(5, short_val);
4285
db2.set(3, string("abc"));
4286
db2.set(4, string("def"));
4287
db1.swap(1, 2, db2, 3); // Swap 1-2 of source with 3-4 of destination.
4288
assert(db1.get<int>(0) == int_val);
4289
assert(db1.get<string>(1) == "abc");
4290
assert(db1.get<string>(2) == "def");
4291
assert(db1.get<int>(3) == int_val);
4292
assert(db1.get<int>(4) == int_val);
4293
assert(db1.block_size() == 3);
4295
assert(db2.get<short>(0) == short_val);
4296
assert(db2.get<short>(1) == short_val);
4297
assert(db2.get<short>(2) == short_val);
4298
assert(db2.get<double>(3) == 2.3);
4299
assert(db2.get<double>(4) == 2.4);
4300
assert(db2.block_size() == 2);
4302
// Merge with the next block in the destination.
4303
db1 = mtv_type(5, int_val);
4304
db2 = mtv_type(5, 12.3);
4305
db2.set(0, string("A"));
4306
db2.set(1, string("B"));
4309
db1.swap(3, 4, db2, 0);
4310
assert(db1.get<int>(0) == int_val);
4311
assert(db1.get<int>(1) == int_val);
4312
assert(db1.get<int>(2) == int_val);
4313
assert(db1.get<string>(3) == "A");
4314
assert(db1.get<string>(4) == "B");
4315
assert(db1.block_size() == 2);
4317
assert(db2.get<double>(0) == 1.1);
4318
assert(db2.get<double>(1) == 1.2);
4319
assert(db2.get<double>(2) == 12.3);
4320
assert(db2.get<double>(3) == 12.3);
4321
assert(db2.get<double>(4) == 12.3);
4322
assert(db2.block_size() == 1);
4324
// Merge with the previous block in the destination.
4325
db1 = mtv_type(5, int_val);
4326
db1.set(2, string("A"));
4327
db1.set(3, string("B"));
4329
db2 = mtv_type(5, string("default"));
4330
db2.set(3, short_val);
4331
db2.set(4, short_val);
4333
db1.swap(2, 3, db2, 3);
4334
assert(db1.get<int>(0) == int_val);
4335
assert(db1.get<int>(1) == int_val);
4336
assert(db1.get<short>(2) == short_val);
4337
assert(db1.get<short>(3) == short_val);
4338
assert(db1.get<int>(4) == int_val);
4339
assert(db1.block_size() == 3);
4341
assert(db2.get<string>(0) == "default");
4342
assert(db2.get<string>(1) == "default");
4343
assert(db2.get<string>(2) == "default");
4344
assert(db2.get<string>(3) == "A");
4345
assert(db2.get<string>(4) == "B");
4346
assert(db2.block_size() == 1);
4348
// Merge with both the previous and next blocks in the destination.
4349
db1 = mtv_type(5, int_val);
4350
db1.set(2, string("C"));
4351
db1.set(3, string("D"));
4353
db2 = mtv_type(6, string("default"));
4354
db2.set(3, short_val);
4355
db2.set(4, short_val);
4357
db1.swap(2, 3, db2, 3);
4358
assert(db1.get<int>(0) == int_val);
4359
assert(db1.get<int>(1) == int_val);
4360
assert(db1.get<short>(2) == short_val);
4361
assert(db1.get<short>(3) == short_val);
4362
assert(db1.get<int>(4) == int_val);
4363
assert(db1.block_size() == 3);
4365
assert(db2.get<string>(0) == "default");
4366
assert(db2.get<string>(1) == "default");
4367
assert(db2.get<string>(2) == "default");
4368
assert(db2.get<string>(3) == "C");
4369
assert(db2.get<string>(4) == "D");
4370
assert(db2.get<string>(5) == "default");
4371
assert(db2.block_size() == 1);
4373
// Set the new elements to the top of a block in the destination.
4374
db1 = mtv_type(5, int_val);
4375
db1.set(3, string("E"));
4376
db1.set(4, string("F"));
4377
db2 = mtv_type(5, short_val);
4378
db1.swap(3, 4, db2, 0);
4379
assert(db1.get<int>(0) == int_val);
4380
assert(db1.get<int>(1) == int_val);
4381
assert(db1.get<int>(2) == int_val);
4382
assert(db1.get<short>(3) == short_val);
4383
assert(db1.get<short>(4) == short_val);
4384
assert(db1.block_size() == 2);
4385
assert(db2.get<string>(0) == "E");
4386
assert(db2.get<string>(1) == "F");
4387
assert(db2.get<short>(2) == short_val);
4388
assert(db2.get<short>(3) == short_val);
4389
assert(db2.get<short>(4) == short_val);
4390
assert(db2.block_size() == 2);
4392
// Do the same as before, but merge with the previous block.
4393
db1 = mtv_type(5, int_val);
4394
db1.set(3, string("G"));
4395
db1.set(4, string("H"));
4396
db2 = mtv_type(5, short_val);
4397
db2.set(0, string("F"));
4398
db1.swap(3, 4, db2, 1);
4399
assert(db1.get<int>(0) == int_val);
4400
assert(db1.get<int>(1) == int_val);
4401
assert(db1.get<int>(2) == int_val);
4402
assert(db1.get<short>(3) == short_val);
4403
assert(db1.get<short>(4) == short_val);
4404
assert(db1.block_size() == 2);
4405
assert(db2.get<string>(0) == "F");
4406
assert(db2.get<string>(1) == "G");
4407
assert(db2.get<string>(2) == "H");
4408
assert(db2.get<short>(3) == short_val);
4409
assert(db2.get<short>(4) == short_val);
4410
assert(db2.block_size() == 2);
4412
// Set the new element to the middle of a destination block.
4413
db1 = mtv_type(5, int_val);
4414
db1.set(3, string("I"));
4415
db1.set(4, string("J"));
4416
db2 = mtv_type(5, short_val);
4417
db2.set(0, string("top"));
4418
db1.swap(3, 4, db2, 2);
4419
assert(db1.get<int>(0) == int_val);
4420
assert(db1.get<int>(1) == int_val);
4421
assert(db1.get<int>(2) == int_val);
4422
assert(db1.get<short>(3) == short_val);
4423
assert(db1.get<short>(4) == short_val);
4424
assert(db1.block_size() == 2);
4426
assert(db2.get<string>(0) == "top");
4427
assert(db2.get<short>(1) == short_val);
4428
assert(db2.get<string>(2) == "I");
4429
assert(db2.get<string>(3) == "J");
4430
assert(db2.get<short>(4) == short_val);
4431
assert(db2.block_size() == 4);
4433
// Set the new element to the lower part of a destination block.
4434
db1 = mtv_type(5, int_val);
4435
db1.set(0, string("A1"));
4436
db1.set(1, string("A2"));
4437
db2 = mtv_type(5, short_val);
4438
db1.swap(0, 1, db2, 3);
4440
assert(db1.get<short>(0) == short_val);
4441
assert(db1.get<short>(1) == short_val);
4442
assert(db1.get<int>(2) == int_val);
4443
assert(db1.get<int>(3) == int_val);
4444
assert(db1.get<int>(4) == int_val);
4445
assert(db1.block_size() == 2);
4447
assert(db2.get<short>(0) == short_val);
4448
assert(db2.get<short>(1) == short_val);
4449
assert(db2.get<short>(2) == short_val);
4450
assert(db2.get<string>(3) == "A1");
4451
assert(db2.get<string>(4) == "A2");
4452
assert(db2.block_size() == 2);
4454
// Same as above, except that the new element will be merged with the next
4455
// block in the destination.
4456
db1 = mtv_type(5, int_val);
4457
db1.set(0, string("A1"));
4458
db1.set(1, string("A2"));
4459
db2 = mtv_type(6, short_val);
4460
db2.set(5, string("A3"));
4461
db1.swap(0, 1, db2, 3);
4463
assert(db1.get<short>(0) == short_val);
4464
assert(db1.get<short>(1) == short_val);
4465
assert(db1.get<int>(2) == int_val);
4466
assert(db1.get<int>(3) == int_val);
4467
assert(db1.get<int>(4) == int_val);
4468
assert(db1.block_size() == 2);
4470
assert(db2.get<short>(0) == short_val);
4471
assert(db2.get<short>(1) == short_val);
4472
assert(db2.get<short>(2) == short_val);
4473
assert(db2.get<string>(3) == "A1");
4474
assert(db2.get<string>(4) == "A2");
4475
assert(db2.get<string>(5) == "A3");
4476
assert(db2.block_size() == 2);
4478
// Swap the top part of source block.
4479
db1 = mtv_type(5, int_val);
4480
db2 = mtv_type(5, short_val);
4481
db1.swap(0, 1, db2, 0);
4483
assert(db1.get<short>(0) == short_val);
4484
assert(db1.get<short>(1) == short_val);
4485
assert(db1.get<int>(2) == int_val);
4486
assert(db1.get<int>(3) == int_val);
4487
assert(db1.get<int>(4) == int_val);
4489
assert(db2.get<int>(0) == int_val);
4490
assert(db2.get<int>(1) == int_val);
4491
assert(db2.get<short>(2) == short_val);
4492
assert(db2.get<short>(3) == short_val);
4493
assert(db2.get<short>(4) == short_val);
4495
// Do the same, and merge with the previous block in the source.
4496
db1 = mtv_type(5, int_val);
4497
db1.set(0, string("A"));
4498
db2 = mtv_type(5, short_val);
4499
db2.set(0, string("B"));
4500
db2.set(1, string("C"));
4501
db1.swap(1, 2, db2, 0);
4503
assert(db1.get<string>(0) == "A");
4504
assert(db1.get<string>(1) == "B");
4505
assert(db1.get<string>(2) == "C");
4506
assert(db1.get<int>(3) == int_val);
4507
assert(db1.get<int>(4) == int_val);
4508
assert(db1.block_size() == 2);
4510
assert(db2.get<int>(0) == int_val);
4511
assert(db2.get<int>(1) == int_val);
4512
assert(db2.get<short>(2) == short_val);
4513
assert(db2.get<short>(3) == short_val);
4514
assert(db2.get<short>(4) == short_val);
4515
assert(db2.block_size() == 2);
4517
// Replace the bottom part of existing source block.
4518
db1 = mtv_type(2, true);
4519
db2 = mtv_type(1, int_val);
4520
db1.swap(1, 1, db2, 0);
4521
assert(db1.get<bool>(0) == true);
4522
assert(db1.get<int>(1) == int_val);
4523
assert(db2.get<bool>(0) == true);
4525
// Do the same, but merge with the next block in the source.
4526
db1 = mtv_type(3, true);
4527
db1.set<int>(2, int_val+1);
4528
db2 = mtv_type(1, int_val);
4529
db1.swap(1, 1, db2, 0);
4530
assert(db1.get<bool>(0) == true);
4531
assert(db1.get<int>(1) == int_val);
4532
assert(db1.get<int>(2) == int_val+1);
4533
assert(db2.get<bool>(0) == true);
4535
// Replace the middle of existing source block.
4537
db1.set<char>(0, 'a');
4538
db1.set<char>(1, 'b');
4539
db1.set<char>(2, 'c');
4540
db1.set<char>(3, 'd');
4541
db1.set<char>(4, 'e');
4545
db1.swap(2, 3, db2, 0);
4546
assert(db1.get<char>(0) == 'a');
4547
assert(db1.get<char>(1) == 'b');
4548
assert(db1.get<double>(2) == 1.1);
4549
assert(db1.get<double>(3) == -1.1);
4550
assert(db1.get<char>(4) == 'e');
4551
assert(db1.block_size() == 3);
4553
assert(db2.get<char>(0) == 'c');
4554
assert(db2.get<char>(1) == 'd');
4555
assert(db2.block_size() == 1);
4557
// Swap single empty block with multiple destination blocks.
4563
db2.set(3, string("abc"));
4564
db2.set(4, string("def"));
4565
db1.swap(0, 3, db2, 1);
4566
assert(db1.get<double>(0) == 2.1);
4567
assert(db1.get<double>(1) == 3.1);
4568
assert(db1.get<string>(2) == "abc");
4569
assert(db1.get<string>(3) == "def");
4570
assert(db1.is_empty(4));
4571
assert(db1.block_size() == 3);
4572
assert(db2.get<double>(0) == 1.1);
4573
assert(db2.is_empty(1));
4574
assert(db2.is_empty(2));
4575
assert(db2.is_empty(3));
4576
assert(db2.is_empty(4));
4577
assert(db2.block_size() == 2);
4579
// Swap non-empty single block with multiple destination blocks.
4580
db1 = mtv_type(4, int_val);
4585
db2.set(3, string("abc"));
4586
db2.set(4, string("def"));
4587
db1.swap(0, 3, db2, 1);
4588
assert(db1.get<double>(0) == 2.1);
4589
assert(db1.get<double>(1) == 3.1);
4590
assert(db1.get<string>(2) == "abc");
4591
assert(db1.get<string>(3) == "def");
4592
assert(db1.block_size() == 2);
4593
assert(db2.get<double>(0) == 1.1);
4594
assert(db2.get<int>(1) == int_val);
4595
assert(db2.get<int>(2) == int_val);
4596
assert(db2.get<int>(3) == int_val);
4597
assert(db2.get<int>(4) == int_val);
4598
assert(db2.block_size() == 2);
4600
// Another scenario.
4601
db1 = mtv_type(2, short_val);
4603
db2.set(0, string("A"));
4604
db2.set<char>(1, 'A');
4605
db1.swap(0, 1, db2, 0);
4606
assert(db1.get<string>(0) == "A");
4607
assert(db1.get<char>(1) == 'A');
4608
assert(db2.get<short>(0) == short_val);
4609
assert(db2.get<short>(1) == short_val);
4611
// Another scenario.
4612
db1 = mtv_type(2, 3.14);
4614
db2.set(0, string("abc"));
4615
db2.set<unsigned char>(1, 'z');
4616
db2.set<unsigned char>(2, 'y');
4617
db1.swap(0, 1, db2, 0);
4618
assert(db1.get<string>(0) == "abc");
4619
assert(db1.get<unsigned char>(1) == 'z');
4620
assert(db2.get<double>(0) == 3.14);
4621
assert(db2.get<double>(1) == 3.14);
4622
assert(db2.get<unsigned char>(2) == 'y');
4624
// Another scenario.
4633
db2.set<char>(1, 'B');
4634
db2.set<long>(2, 123);
4635
db1.swap(0, 2, db2, 0);
4636
assert(db1.get<double>(0) == 2.3);
4637
assert(db1.get<char>(1) == 'B');
4638
assert(db1.get<long>(2) == 123);
4639
assert(db1.get<int>(3) == 4);
4640
assert(db1.get<int>(4) == 5);
4641
assert(db2.get<int>(0) == 1);
4642
assert(db2.get<int>(1) == 2);
4643
assert(db2.get<int>(2) == 3);
4644
assert(db2.block_size() == 1);
4647
db1 = mtv_type(3, string("test"));
4650
db2.set(1, string("foo"));
4651
db1.swap(1, 2, db2, 0);
4652
assert(db1.get<string>(0) == "test");
4653
assert(db1.get<double>(1) == -99.1);
4654
assert(db1.get<string>(2) == "foo");
4655
assert(db2.get<string>(0) == "test");
4656
assert(db2.get<string>(1) == "test");
4658
// The source range is in the middle of a block.
4660
for (int i = 0; i < 8; ++i)
4661
db1.set<int>(i, i+2);
4663
db2.set<int>(0, 12);
4664
db2.set<short>(1, 13);
4665
db2.set<long>(2, 14);
4666
db2.set<double>(3, 15.0);
4667
db1.swap(3, 5, db2, 1);
4669
assert(db1.get<int>(0) == 2);
4670
assert(db1.get<int>(1) == 3);
4671
assert(db1.get<int>(2) == 4);
4672
assert(db1.get<short>(3) == 13);
4673
assert(db1.get<long>(4) == 14);
4674
assert(db1.get<double>(5) == 15.0);
4675
assert(db1.get<int>(6) == 8);
4676
assert(db1.get<int>(7) == 9);
4678
assert(db2.get<int>(0) == 12);
4679
assert(db2.get<int>(1) == 5);
4680
assert(db2.get<int>(2) == 6);
4681
assert(db2.get<int>(3) == 7);
4682
assert(db2.block_size() == 1);
4684
// Try swapping in a multi-to-single block direction.
4687
db1.set(1, string("123"));
4688
db2 = mtv_type(10, short_val);
4689
db1.swap(0, 1, db2, 4);
4690
assert(db1.get<short>(0) == short_val);
4691
assert(db1.get<short>(1) == short_val);
4693
assert(db2.get<short>(0) == short_val);
4694
assert(db2.get<short>(1) == short_val);
4695
assert(db2.get<short>(2) == short_val);
4696
assert(db2.get<short>(3) == short_val);
4697
assert(db2.get<double>(4) == 1.2);
4698
assert(db2.get<string>(5) == "123");
4699
assert(db2.get<short>(6) == short_val);
4700
assert(db2.get<short>(7) == short_val);
4701
assert(db2.get<short>(8) == short_val);
4702
assert(db2.get<short>(9) == short_val);
4704
// Multi-to-multi block swapping. Very simple case.
4707
db1.set(1, string("test"));
4709
db2.set(0, int_val);
4710
db2.set(1, short_val);
4711
db1.swap(0, 1, db2, 0);
4713
assert(db1.get<int>(0) == int_val);
4714
assert(db1.get<short>(1) == short_val);
4715
assert(db2.get<double>(0) == 2.1);
4716
assert(db2.get<string>(1) == "test");
4718
// More complex case.
4723
db1.set<string>(3, "A");
4724
db1.set<string>(4, "B");
4725
db1.set<string>(5, "C");
4726
// Leave some empty range.
4728
for (int i = 0; i < 10; ++i)
4729
db2.set<int>(i, 10+i);
4730
db2.set<char>(5, 'Z');
4731
db1.swap(1, 7, db2, 2);
4733
assert(db1.get<int>(0) == 2);
4734
assert(db1.get<int>(1) == 12);
4735
assert(db1.get<int>(2) == 13);
4736
assert(db1.get<int>(3) == 14);
4737
assert(db1.get<char>(4) == 'Z');
4738
assert(db1.get<int>(5) == 16);
4739
assert(db1.get<int>(6) == 17);
4740
assert(db1.get<int>(7) == 18);
4741
assert(db1.is_empty(8));
4742
assert(db1.is_empty(9));
4743
assert(db1.block_size() == 4);
4745
assert(db2.get<int>(0) == 10);
4746
assert(db2.get<int>(1) == 11);
4747
assert(db2.get<int>(2) == 3);
4748
assert(db2.get<int>(3) == 4);
4749
assert(db2.get<string>(4) == "A");
4750
assert(db2.get<string>(5) == "B");
4751
assert(db2.get<string>(6) == "C");
4752
assert(db2.is_empty(7));
4753
assert(db2.is_empty(8));
4754
assert(db2.get<int>(9) == 19);
4755
assert(db2.block_size() == 4);
4758
struct block_node_printer : unary_function<mtv_type::value_type, void>
4760
void operator() (const mtv_type::value_type& node) const
4762
cout << "type: " << node.type << " size: " << node.size << " data: " << node.data << endl;
4766
void mtv_test_value_type()
4768
stack_printer __stack_printer__("::mtv_test_value_type");
4771
db.set(1, string("A"));
4772
db.set(2, string("B"));
4774
db.set(4, short(8));
4775
for_each(db.begin(), db.end(), block_node_printer());
4778
void mtv_test_block_identifier()
4780
stack_printer __stack_printer__("::mtv_test_block_identifier");
4781
assert(mtv::numeric_element_block::block_type == mtv::element_type_numeric);
4782
assert(mtv::string_element_block::block_type == mtv::element_type_string);
4783
assert(mtv::short_element_block::block_type == mtv::element_type_short);
4784
assert(mtv::ushort_element_block::block_type == mtv::element_type_ushort);
4785
assert(mtv::int_element_block::block_type == mtv::element_type_int);
4786
assert(mtv::uint_element_block::block_type == mtv::element_type_uint);
4787
assert(mtv::long_element_block::block_type == mtv::element_type_long);
4788
assert(mtv::ulong_element_block::block_type == mtv::element_type_ulong);
4789
assert(mtv::boolean_element_block::block_type == mtv::element_type_boolean);
4790
assert(mtv::char_element_block::block_type == mtv::element_type_char);
4791
assert(mtv::uchar_element_block::block_type == mtv::element_type_uchar);
4153
4796
int main (int argc, char **argv)
4156
if (!parse_cmd_options(argc, argv, opt))
4157
return EXIT_FAILURE;
4162
mtv_test_construction();
4164
mtv_test_empty_cells();
4166
mtv_test_equality();
4170
mtv_test_insert_empty();
4171
mtv_test_set_cells();
4172
mtv_test_insert_cells();
4173
mtv_test_iterators();
4174
mtv_test_data_iterators();
4175
mtv_test_non_const_data_iterators();
4176
mtv_test_iterator_private_data();
4177
mtv_test_set_return_iterator();
4178
mtv_test_set2_return_iterator();
4179
mtv_test_insert_cells_return_iterator();
4180
mtv_test_set_empty_return_iterator();
4181
mtv_test_insert_empty_return_iterator();
4182
mtv_test_set_with_position();
4183
mtv_test_set_cells_with_position();
4184
mtv_test_insert_cells_with_position();
4185
mtv_test_set_empty_with_position();
4186
mtv_test_insert_empty_with_position();
4187
mtv_test_position();
4192
mtv_perf_test_block_position_lookup();
4799
mtv_test_construction();
4801
mtv_test_empty_cells();
4803
mtv_test_equality();
4807
mtv_test_insert_empty();
4808
mtv_test_set_cells();
4809
mtv_test_insert_cells();
4810
mtv_test_iterators();
4811
mtv_test_data_iterators();
4812
mtv_test_non_const_data_iterators();
4813
mtv_test_iterator_private_data();
4814
mtv_test_set_return_iterator();
4815
mtv_test_set2_return_iterator();
4816
mtv_test_insert_cells_return_iterator();
4817
mtv_test_set_empty_return_iterator();
4818
mtv_test_insert_empty_return_iterator();
4819
mtv_test_set_with_position();
4820
mtv_test_set_cells_with_position();
4821
mtv_test_insert_cells_with_position();
4822
mtv_test_set_empty_with_position();
4823
mtv_test_insert_empty_with_position();
4824
mtv_test_position();
4825
mtv_test_next_position();
4826
mtv_test_swap_range();
4827
mtv_test_value_type();
4828
mtv_test_block_identifier();
4195
4830
cout << "Test finished successfully!" << endl;
4196
4831
return EXIT_SUCCESS;