• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

GothenburgBitFactory / taskwarrior / 13092392630

01 Feb 2025 09:02PM UTC coverage: 85.047% (+0.01%) from 85.036%
13092392630

Pull #3770

github

web-flow
Merge 26ee3bc53 into 244513fad
Pull Request #3770: Test for unusual task data

70 of 77 new or added lines in 7 files covered. (90.91%)

21 existing lines in 2 files now uncovered.

19537 of 22972 relevant lines covered (85.05%)

23299.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

79.17
/test/make_tc_task.cpp
1
////////////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright 2025, Dustin J. Mitchell
4
//
5
// Permission is hereby granted, free of charge, to any person obtaining a copy
6
// of this software and associated documentation files (the "Software"), to deal
7
// in the Software without restriction, including without limitation the rights
8
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
// copies of the Software, and to permit persons to whom the Software is
10
// furnished to do so, subject to the following conditions:
11
//
12
// The above copyright notice and this permission notice shall be included
13
// in all copies or substantial portions of the Software.
14
//
15
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
// SOFTWARE.
22
//
23
// https://www.opensource.org/licenses/mit-license.php
24
//
25
////////////////////////////////////////////////////////////////////////////////
26

27
#include <cmake.h>
28
// cmake.h include header must come first
29

30
#include <CmdInfo.h>
31
#include <main.h>
32
#include <stdlib.h>
33
#include <taskchampion-cpp/lib.h>
34
#include <test.h>
35
#include <util.h>
36

37
#include <iostream>
38
#include <limits>
39

40
#include "format.h"
41

42
namespace {
43

44
////////////////////////////////////////////////////////////////////////////////
NEW
45
int usage() {
×
NEW
46
  std::cerr << "USAGE: make_tc_task DATADIR KEY=VALUE ..\n";
×
NEW
47
  return 1;
×
48
}
49

50
}  // namespace
51

52
////////////////////////////////////////////////////////////////////////////////
53
int main(int argc, char **argv) {
14✔
54
  if (!--argc) {
14✔
NEW
55
    return usage();
×
56
  }
57
  char *datadir = *++argv;
14✔
58

59
  auto replica = tc::new_replica_on_disk(datadir, true);
14✔
60
  auto uuid = tc::uuid_v4();
14✔
61
  auto operations = tc::new_operations();
14✔
62
  auto task = tc::create_task(uuid, operations);
14✔
63

64
  while (--argc) {
64✔
65
    std::string arg = *++argv;
50✔
66
    size_t eq_idx = arg.find('=');
50✔
67
    if (eq_idx == std::string::npos) {
50✔
NEW
68
      return usage();
×
69
    }
70
    std::string property = arg.substr(0, eq_idx);
50✔
71
    std::string value = arg.substr(eq_idx + 1);
50✔
72
    task->update(property, value, operations);
50✔
73
  }
50✔
74
  replica->commit_operations(std::move(operations));
14✔
75

76
  std::cout << static_cast<std::string>(uuid.to_string()) << "\n";
14✔
77
  return 0;
14✔
78
}
14✔
79

80
////////////////////////////////////////////////////////////////////////////////
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc