Merge lp:~ted/libmetrics/study-version into lp:libmetrics

Proposed by Ted Gould
Status: Merged
Merged at revision: 61
Proposed branch: lp:~ted/libmetrics/study-version
Merge into: lp:libmetrics
Diff against target: 84 lines (+19/-1)
8 files modified
libmetrics/collector.c (+4/-1)
tests/studies/bad-no-administrator (+1/-0)
tests/studies/bad-no-description (+1/-0)
tests/studies/bad-no-name (+1/-0)
tests/studies/bad-no-version (+4/-0)
tests/studies/bad-version-200 (+5/-0)
tests/studies/good (+1/-0)
tests/test-collector.cc (+2/-0)
To merge this branch: bzr merge lp:~ted/libmetrics/study-version
Reviewer Review Type Date Requested Status
Metrics Pending
Review via email: mp+106044@code.launchpad.net

Description of the change

Adding a version number to the study file

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libmetrics/collector.c'
2--- libmetrics/collector.c 2012-05-16 17:48:32 +0000
3+++ libmetrics/collector.c 2012-05-16 18:22:18 +0000
4@@ -196,7 +196,10 @@
5 if (g_key_file_has_group(keyfile, "Metrics Study") &&
6 g_key_file_has_key(keyfile, "Metrics Study", "Name", NULL) &&
7 g_key_file_has_key(keyfile, "Metrics Study", "Description", NULL) &&
8- g_key_file_has_key(keyfile, "Metrics Study", "Administrator", NULL)) {
9+ g_key_file_has_key(keyfile, "Metrics Study", "Version", NULL) &&
10+ g_key_file_has_key(keyfile, "Metrics Study", "Administrator", NULL) &&
11+ g_key_file_get_int64(keyfile, "Metrics Study", "Version", NULL) == 1
12+ ) {
13 self->priv->study = g_strdup(study);
14 }
15
16
17=== modified file 'tests/studies/bad-no-administrator'
18--- tests/studies/bad-no-administrator 2012-05-16 17:48:32 +0000
19+++ tests/studies/bad-no-administrator 2012-05-16 18:22:18 +0000
20@@ -1,3 +1,4 @@
21 [Metrics Study]
22 Name=Bad Study
23+Version=1
24 Description=A study that is missing an administrator
25
26=== modified file 'tests/studies/bad-no-description'
27--- tests/studies/bad-no-description 2012-05-16 17:48:32 +0000
28+++ tests/studies/bad-no-description 2012-05-16 18:22:18 +0000
29@@ -1,3 +1,4 @@
30 [Metrics Study]
31 Name=Bad Study
32+Version=1
33 Administrator=libmetrics Developers
34
35=== modified file 'tests/studies/bad-no-name'
36--- tests/studies/bad-no-name 2012-05-16 17:48:32 +0000
37+++ tests/studies/bad-no-name 2012-05-16 18:22:18 +0000
38@@ -1,3 +1,4 @@
39 [Metrics Study]
40+Version=1
41 Description=A study that is missing a name
42 Administrator=libmetrics Developers
43
44=== added file 'tests/studies/bad-no-version'
45--- tests/studies/bad-no-version 1970-01-01 00:00:00 +0000
46+++ tests/studies/bad-no-version 2012-05-16 18:22:18 +0000
47@@ -0,0 +1,4 @@
48+[Metrics Study]
49+Name=Bad Study
50+Description=A study that has no version specified
51+Administrator=libmetrics Developers
52
53=== added file 'tests/studies/bad-version-200'
54--- tests/studies/bad-version-200 1970-01-01 00:00:00 +0000
55+++ tests/studies/bad-version-200 2012-05-16 18:22:18 +0000
56@@ -0,0 +1,5 @@
57+[Metrics Study]
58+Name=Bad Study
59+Version=200
60+Description=A study that has a version number of 200
61+Administrator=libmetrics Developers
62
63=== modified file 'tests/studies/good'
64--- tests/studies/good 2012-05-16 17:48:32 +0000
65+++ tests/studies/good 2012-05-16 18:22:18 +0000
66@@ -1,4 +1,5 @@
67 [Metrics Study]
68 Name=Good Study
69+Version=1
70 Description=A study that is good for testing
71 Administrator=libmetrics Developers
72
73=== modified file 'tests/test-collector.cc'
74--- tests/test-collector.cc 2012-05-16 17:48:32 +0000
75+++ tests/test-collector.cc 2012-05-16 18:22:18 +0000
76@@ -70,6 +70,8 @@
77
78 TEST_F(TestCollector, bad_studies) {
79 test_bad("bad-no-administrator");
80+ test_bad("bad-no-version");
81+ test_bad("bad-version-200");
82 test_bad("bad-no-description");
83 test_bad("bad-no-name");
84 test_bad("bad-xml");

Subscribers

People subscribed via source and target branches

to all changes: