mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-24 15:05:22 -04:00
fix build
This commit is contained in:
parent
627066dd27
commit
ab4f05a347
15 changed files with 215 additions and 220 deletions
|
@ -1,4 +1,4 @@
|
|||
@Timeout(Duration(seconds: 120))
|
||||
@Timeout(Duration(seconds: 240))
|
||||
|
||||
library veilid_support_integration_test;
|
||||
|
||||
|
@ -26,13 +26,6 @@ void main() {
|
|||
setUpAll(veilidFixture.setUp);
|
||||
tearDownAll(veilidFixture.tearDown);
|
||||
|
||||
// group('Crypto Tests', () {
|
||||
// test('best cryptosystem', testBestCryptoSystem);
|
||||
// test('get cryptosystem', testGetCryptoSystem);
|
||||
// test('get cryptosystem invalid', testGetCryptoSystemInvalid);
|
||||
// test('hash and verify password', testHashAndVerifyPassword);
|
||||
// });
|
||||
|
||||
group('Attached Tests', () {
|
||||
setUpAll(veilidFixture.attach);
|
||||
tearDownAll(veilidFixture.detach);
|
||||
|
@ -45,21 +38,25 @@ void main() {
|
|||
|
||||
test('create pool', testDHTRecordPoolCreate);
|
||||
|
||||
// group('DHTRecordPool Tests', () {
|
||||
// setUpAll(dhtRecordPoolFixture.setUp);
|
||||
// tearDownAll(dhtRecordPoolFixture.tearDown);
|
||||
group('DHTRecordPool Tests', () {
|
||||
setUpAll(dhtRecordPoolFixture.setUp);
|
||||
tearDownAll(dhtRecordPoolFixture.tearDown);
|
||||
|
||||
// test('create/delete record', testDHTRecordCreateDelete);
|
||||
// test('record scopes', testDHTRecordScopes);
|
||||
// test('create/delete deep record', testDHTRecordDeepCreateDelete);
|
||||
// });
|
||||
test('create/delete record', testDHTRecordCreateDelete);
|
||||
test('record scopes', testDHTRecordScopes);
|
||||
test('create/delete deep record', testDHTRecordDeepCreateDelete);
|
||||
});
|
||||
|
||||
group('DHTShortArray Tests', () {
|
||||
setUpAll(dhtRecordPoolFixture.setUp);
|
||||
tearDownAll(dhtRecordPoolFixture.tearDown);
|
||||
|
||||
// test('create shortarray', testDHTShortArrayCreateDelete);
|
||||
test('add shortarray', testDHTShortArrayAdd);
|
||||
for (final stride in [256, 64, 32, 16, 8, 4, 2, 1]) {
|
||||
test('create shortarray stride=$stride',
|
||||
makeTestDHTShortArrayCreateDelete(stride: stride));
|
||||
test('add shortarray stride=$stride',
|
||||
makeTestDHTShortArrayAdd(stride: 256));
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -3,86 +3,99 @@ import 'dart:convert';
|
|||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:veilid_support/veilid_support.dart';
|
||||
|
||||
Future<void> testDHTShortArrayCreateDelete() async {
|
||||
// Close before delete
|
||||
{
|
||||
final arr = await DHTShortArray.create(debugName: 'sa_create_delete 1');
|
||||
expect(await arr.operate((r) async => r.length), isZero);
|
||||
expect(arr.isOpen, isTrue);
|
||||
await arr.close();
|
||||
expect(arr.isOpen, isFalse);
|
||||
await arr.delete();
|
||||
// Operate should fail
|
||||
await expectLater(() async => arr.operate((r) async => r.length),
|
||||
throwsA(isA<StateError>()));
|
||||
}
|
||||
|
||||
// Close after delete
|
||||
{
|
||||
final arr = await DHTShortArray.create(debugName: 'sa_create_delete 2');
|
||||
await arr.delete();
|
||||
// Operate should still succeed because things aren't closed
|
||||
expect(await arr.operate((r) async => r.length), isZero);
|
||||
await arr.close();
|
||||
// Operate should fail
|
||||
await expectLater(() async => arr.operate((r) async => r.length),
|
||||
throwsA(isA<StateError>()));
|
||||
}
|
||||
|
||||
// Close after delete multiple
|
||||
// Okay to request delete multiple times before close
|
||||
{
|
||||
final arr = await DHTShortArray.create(debugName: 'sa_create_delete 3');
|
||||
await arr.delete();
|
||||
await arr.delete();
|
||||
// Operate should still succeed because things aren't closed
|
||||
expect(await arr.operate((r) async => r.length), isZero);
|
||||
await arr.close();
|
||||
await arr.close();
|
||||
// Operate should fail
|
||||
await expectLater(() async => arr.operate((r) async => r.length),
|
||||
throwsA(isA<StateError>()));
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> testDHTShortArrayAdd() async {
|
||||
final arr = await DHTShortArray.create(debugName: 'sa_add 1');
|
||||
|
||||
final dataset =
|
||||
Iterable<int>.generate(256).map((n) => utf8.encode('elem $n')).toList();
|
||||
|
||||
print('adding');
|
||||
{
|
||||
final (res, ok) = await arr.operateWrite((w) async {
|
||||
for (var n = 0; n < dataset.length; n++) {
|
||||
print('add $n');
|
||||
final success = await w.tryAddItem(dataset[n]);
|
||||
expect(success, isTrue);
|
||||
Future<void> Function() makeTestDHTShortArrayCreateDelete(
|
||||
{required int stride}) =>
|
||||
() async {
|
||||
// Close before delete
|
||||
{
|
||||
final arr = await DHTShortArray.create(
|
||||
debugName: 'sa_create_delete 1 stride $stride', stride: stride);
|
||||
expect(await arr.operate((r) async => r.length), isZero);
|
||||
expect(arr.isOpen, isTrue);
|
||||
await arr.close();
|
||||
expect(arr.isOpen, isFalse);
|
||||
await arr.delete();
|
||||
// Operate should fail
|
||||
await expectLater(() async => arr.operate((r) async => r.length),
|
||||
throwsA(isA<StateError>()));
|
||||
}
|
||||
});
|
||||
expect(res, isNull);
|
||||
expect(ok, isTrue);
|
||||
}
|
||||
|
||||
print('get all');
|
||||
{
|
||||
final dataset2 = await arr.operate((r) async => r.getAllItems());
|
||||
expect(dataset2, equals(dataset));
|
||||
}
|
||||
// Close after delete
|
||||
{
|
||||
final arr = await DHTShortArray.create(
|
||||
debugName: 'sa_create_delete 2 stride $stride', stride: stride);
|
||||
await arr.delete();
|
||||
// Operate should still succeed because things aren't closed
|
||||
expect(await arr.operate((r) async => r.length), isZero);
|
||||
await arr.close();
|
||||
// Operate should fail
|
||||
await expectLater(() async => arr.operate((r) async => r.length),
|
||||
throwsA(isA<StateError>()));
|
||||
}
|
||||
|
||||
print('clear');
|
||||
{
|
||||
final (res, ok) = await arr.operateWrite((w) async => w.tryClear());
|
||||
expect(res, isTrue);
|
||||
expect(ok, isTrue);
|
||||
}
|
||||
// Close after delete multiple
|
||||
// Okay to request delete multiple times before close
|
||||
{
|
||||
final arr = await DHTShortArray.create(
|
||||
debugName: 'sa_create_delete 3 stride $stride', stride: stride);
|
||||
await arr.delete();
|
||||
await arr.delete();
|
||||
// Operate should still succeed because things aren't closed
|
||||
expect(await arr.operate((r) async => r.length), isZero);
|
||||
await arr.close();
|
||||
await arr.close();
|
||||
// Operate should fail
|
||||
await expectLater(() async => arr.operate((r) async => r.length),
|
||||
throwsA(isA<StateError>()));
|
||||
}
|
||||
};
|
||||
|
||||
print('get all');
|
||||
{
|
||||
final dataset3 = await arr.operate((r) async => r.getAllItems());
|
||||
expect(dataset3, isEmpty);
|
||||
}
|
||||
Future<void> Function() makeTestDHTShortArrayAdd({required int stride}) =>
|
||||
() async {
|
||||
final startTime = DateTime.now();
|
||||
|
||||
await arr.delete();
|
||||
await arr.close();
|
||||
}
|
||||
final arr = await DHTShortArray.create(
|
||||
debugName: 'sa_add 1 stride $stride', stride: stride);
|
||||
|
||||
final dataset = Iterable<int>.generate(256)
|
||||
.map((n) => utf8.encode('elem $n'))
|
||||
.toList();
|
||||
|
||||
print('adding\n');
|
||||
{
|
||||
final (res, ok) = await arr.operateWrite((w) async {
|
||||
for (var n = 0; n < dataset.length; n++) {
|
||||
print('$n ');
|
||||
final success = await w.tryAddItem(dataset[n]);
|
||||
expect(success, isTrue);
|
||||
}
|
||||
});
|
||||
expect(res, isNull);
|
||||
expect(ok, isTrue);
|
||||
}
|
||||
|
||||
//print('get all\n');
|
||||
{
|
||||
final dataset2 = await arr.operate((r) async => r.getAllItems());
|
||||
expect(dataset2, equals(dataset));
|
||||
}
|
||||
|
||||
//print('clear\n');
|
||||
{
|
||||
final (res, ok) = await arr.operateWrite((w) async => w.tryClear());
|
||||
expect(res, isTrue);
|
||||
expect(ok, isTrue);
|
||||
}
|
||||
|
||||
//print('get all\n');
|
||||
{
|
||||
final dataset3 = await arr.operate((r) async => r.getAllItems());
|
||||
expect(dataset3, isEmpty);
|
||||
}
|
||||
|
||||
await arr.delete();
|
||||
await arr.close();
|
||||
|
||||
final endTime = DateTime.now();
|
||||
print('Duration: ${endTime.difference(startTime)}');
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ EXTERNAL SOURCES:
|
|||
|
||||
SPEC CHECKSUMS:
|
||||
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
|
||||
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
|
||||
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
||||
veilid: a54f57b7bcf0e4e072fe99272d76ca126b2026d0
|
||||
|
||||
PODFILE CHECKSUM: 16208599a12443d53889ba2270a4985981cfb204
|
||||
|
|
|
@ -13,10 +13,10 @@ packages:
|
|||
dependency: "direct dev"
|
||||
description:
|
||||
name: async_tools
|
||||
sha256: "972f68ab663724d86260a31e363c1355ff493308441b872bf4e7b8adc67c832c"
|
||||
sha256: e783ac6ed5645c86da34240389bb3a000fc5e3ae6589c6a482eb24ece7217681
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.0"
|
||||
version: "0.1.1"
|
||||
bloc:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -29,10 +29,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: bloc_advanced_tools
|
||||
sha256: bc0e1d5c26ae7df011464ab6abc2134dcfb668952acc87359abc7457cab091dd
|
||||
sha256: "09f8a121d950575f1f2980c8b10df46b2ac6c72c8cbe48cc145871e5882ed430"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.0"
|
||||
version: "0.1.1"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -283,10 +283,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_foundation
|
||||
sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f"
|
||||
sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.2"
|
||||
version: "2.4.0"
|
||||
path_provider_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -7,14 +7,14 @@ environment:
|
|||
sdk: '>=3.3.4 <4.0.0'
|
||||
|
||||
dependencies:
|
||||
cupertino_icons: ^1.0.6
|
||||
cupertino_icons: ^1.0.8
|
||||
flutter:
|
||||
sdk: flutter
|
||||
veilid_support:
|
||||
path: ../
|
||||
|
||||
dev_dependencies:
|
||||
async_tools: ^0.1.0
|
||||
async_tools: ^0.1.1
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
integration_test:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue