MCPcopy Create free account
hub / github.com/Parchive/par2cmdline / test5

Function test5

src/commandline_test.cpp:30–88  ·  view source on GitHub ↗

ComputeRecoveryBlockCount recoveryblockset = true

Source from the content-addressed store, hash-verified

28// ComputeRecoveryBlockCount
29// recoveryblockset = true
30int test5() {
31 u32 recoveryblockcount = 42;
32 bool success = CommandLine::ComputeRecoveryBlockCount(&recoveryblockcount,
33 100,
34 4,
35 0,
36 scVariable,
37 0,
38 true,
39 0,
40 0,
41 40);
42 if (!success) {
43 std::cerr << "ComputeRecoveryBlockCount failed test5.1" << std::endl;
44 return 1;
45 }
46 if (recoveryblockcount != 42) {
47 std::cerr << "ComputeRecoveryBlockCount should not overwrite recoveryblockcount" << std::endl;
48 std::cerr << " it returned " << recoveryblockcount << std::endl;
49 return 1;
50 }
51
52
53 recoveryblockcount = 66000;
54 success = CommandLine::ComputeRecoveryBlockCount(&recoveryblockcount,
55 100,
56 4,
57 0,
58 scVariable,
59 0,
60 true,
61 0,
62 0,
63 40);
64 if (success) {
65 std::cerr << "ComputeRecoveryBlockCount should fail for too many blocks" << std::endl;
66 return 1;
67 }
68
69
70
71 recoveryblockcount = 6000;
72 success = CommandLine::ComputeRecoveryBlockCount(&recoveryblockcount,
73 100,
74 4,
75 60000,
76 scVariable,
77 0,
78 true,
79 0,
80 0,
81 40);
82 if (success) {
83 std::cerr << "ComputeRecoveryBlockCount should fail for too high a coefficient" << std::endl;
84 return 1;
85 }
86
87 return 0;

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected