[Pkg-mozext-commits] [perspectives-extension] 18/44: Unit tests - Add setup asserts for several other tests

David Prévot taffit at moszumanska.debian.org
Sat Jun 6 02:55:28 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository perspectives-extension.

commit 8840617d8696f656af13ab2ab6c4ff92af14e012
Author: Dave Schaefer <dave.schaefer at gmail.com>
Date:   Mon Nov 3 21:34:15 2014 -0700

    Unit tests - Add setup asserts for several other tests
    
    All of the data needs to be valid before we test with it.
---
 test/test.html | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/test/test.html b/test/test.html
index 49562d7..e6f99ee 100644
--- a/test/test.html
+++ b/test/test.html
@@ -392,6 +392,9 @@ function quorum_basics() {
 
     var quorum_duration = 0;
 
+    assert_setup(key_end_time > 0, "key_end_time > 0");
+    assert_setup(key_end_time > key_beg_time, "key_end_time >  key_beg_time");
+
     quorum_duration = Pers_client_policy.get_quorum_duration(key1, server_result_list, 2, max_stale_sec, cur_time);
     assert(quorum_duration === cur_time - key_beg_time + 1  , "Requiring larger quorum gives a shorter duration");
 
@@ -607,6 +610,8 @@ function quorum_basics() {
         }
     ];
 
+    assert_setup(short_end >= short_start, "short key ends after it begins ");
+
     // place cur_time within the 'valid range' cutoff
     cur_time      =   1 * DAY_SECS;
     max_stale_sec = 200;
@@ -759,6 +764,26 @@ function quorum_oldkey() {
     write_string("Starting oldkey quorum tests...");
     var quorum_duration = 0;
 
+    assert_setup(results_oldkey[0].obs[0].timestamps[0].end >=
+     results_oldkey[0].obs[0].timestamps[0].start,
+       "oldkey ends after it starts");
+
+    assert_setup(results_oldkey_notpushed[0].obs[0].timestamps[0].end >=
+       results_oldkey_notpushed[0].obs[0].timestamps[0].start,
+       "results_oldkey_notpushed 0 ends after it starts");
+
+    assert_setup(results_oldkey_notpushed[1].obs[0].timestamps[0].end >=
+       results_oldkey_notpushed[1].obs[0].timestamps[0].start,
+       "results_oldkey_notpushed 1 ends after it starts");
+
+     assert_setup(results_oldkey_pushedout[0].obs[0].timestamps[0].end >=
+       results_oldkey_pushedout[0].obs[0].timestamps[0].start,
+       "results_oldkey_pushedout 0 ends after it starts");
+
+    assert_setup(results_oldkey_pushedout[1].obs[0].timestamps[0].end >=
+       results_oldkey_pushedout[1].obs[0].timestamps[0].start,
+       "results_oldkey_pushedout 1 ends after it starts");
+
     quorum_duration = Pers_client_policy.get_quorum_duration(keybc, results_oldkey, q_required, max_stale_sec, cur_time);
     assert(quorum_duration >= q_duration_required    , "1) Old key within duration accepted");
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/perspectives-extension.git



More information about the Pkg-mozext-commits mailing list