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

GothenburgBitFactory / taskwarrior / 13092109049

01 Feb 2025 08:21PM UTC coverage: 85.12% (+0.06%) from 85.063%
13092109049

Pull #3770

github

web-flow
Merge 675126e07 into 8d210b526
Pull Request #3770: Test for unusual task data

64 of 71 new or added lines in 7 files covered. (90.14%)

6 existing lines in 4 files now uncovered.

19552 of 22970 relevant lines covered (85.12%)

23291.36 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) {
13✔
54
  if (!--argc) {
13✔
NEW
55
    return usage();
×
56
  }
57
  char *datadir = *++argv;
13✔
58

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

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

76
  std::cout << static_cast<std::string>(uuid.to_string()) << "\n";
13✔
77
  return 0;
13✔
78
}
13✔
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