OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-learn commits / 8fd22a3

Revert "Remove cog-count from unit test"
This reverts commit c330f07f4efaeb0d00dcbf97da80a878da528f2f.
8fd22a37ba9d4d70cd66b3cf6ec460b8e77dfcc3
by Linas Vepstas <linasvepstas@gmail.com> · 2025-11-04T08:52:54.000Z

Changed files (1) +12 -12

tests/merge/connector-balance-tridonor.scm +12 -12
……@@ -52,12 +52,12 @@
5252 (test-equal 3 (length (gsc 'right-stars (Word "c"))))
5353
5454 ; Get the total count on all Sections
55 (define totcnt (fold + 0 (map (lambda (atm) (gsc 'get-count atm)) (cog-get-atoms 'Section))))
55 (define totcnt (fold + 0 (map cog-count (cog-get-atoms 'Section))))
5656
5757 ; Create CrossSections and verify that they got created
5858 (gsc 'explode-sections)
5959 (test-equal 19 (length (cog-get-atoms 'CrossSection)))
60 (define totcross (fold + 0 (map (lambda (atm) (gsc 'get-count atm)) (cog-get-atoms 'CrossSection))))
60 (define totcross (fold + 0 (map cog-count (cog-get-atoms 'CrossSection))))
6161
6262 ; Verify that direct-sum object is accessing shapes correctly
6363 ; i.e. the 'explode should have created some CrossSections
……@@ -95,7 +95,7 @@
9595 ; --------------
9696 ; Validate counts.
9797 (define tot-ab
98 (fold (lambda (atm cnt) (+ cnt (gsc 'get-count atm))) 0
98 (fold (lambda (atm cnt) (+ cnt (cog-count atm))) 0
9999 (gsc 'right-stars WC-AB)))
100100 (define epsilon 1.0e-8)
101101 (test-approximate
……@@ -106,17 +106,17 @@
106106 ; To gain access to the counts, load them by name.
107107 (expected-aba-sections WC-AB)
108108
109 (test-approximate (+ cnt-a-gh cnt-b-gh) (gsc 'get-count sec-ab-gh) epsilon)
109 (test-approximate (+ cnt-a-gh cnt-b-gh) (cog-count sec-ab-gh) epsilon)
110110
111111 (define cnt-c-tot (+ cnt-c-aaa cnt-c-aab cnt-c-aba))
112 (test-approximate cnt-c-tot (gsc 'get-count sec-c-aaa) epsilon)
112 (test-approximate cnt-c-tot (cog-count sec-c-aaa) epsilon)
113113
114114 ; Validate counts on CrossSections...
115 (test-approximate cnt-c-tot (gsc 'get-count xes-k-c-vaaam) epsilon)
116 (test-approximate cnt-c-tot (gsc 'get-count xes-a-c-kvaam) epsilon)
117 (test-approximate cnt-c-tot (gsc 'get-count xes-a-c-kavam) epsilon)
118 (test-approximate cnt-c-tot (gsc 'get-count xes-a-c-kaavm) epsilon)
119 (test-approximate cnt-c-tot (gsc 'get-count xes-m-c-kaaav) epsilon)
115 (test-approximate cnt-c-tot (cog-count xes-k-c-vaaam) epsilon)
116 (test-approximate cnt-c-tot (cog-count xes-a-c-kvaam) epsilon)
117 (test-approximate cnt-c-tot (cog-count xes-a-c-kavam) epsilon)
118 (test-approximate cnt-c-tot (cog-count xes-a-c-kaavm) epsilon)
119 (test-approximate cnt-c-tot (cog-count xes-m-c-kaaav) epsilon)
120120
121121 ; -----------------------
122122 ; Verify detailed balance
……@@ -125,9 +125,9 @@
125125 (test-assert (check-shapes gsc epsilon))
126126
127127 ; Verify no change in totals
128 (test-approximate totcnt (fold + 0 (map (lambda (atm) (gsc 'get-count atm)) (cog-get-atoms 'Section)))
128 (test-approximate totcnt (fold + 0 (map cog-count (cog-get-atoms 'Section)))
129129 epsilon)
130 (test-approximate totcross (fold + 0 (map (lambda (atm) (gsc 'get-count atm)) (cog-get-atoms 'CrossSection)))
130 (test-approximate totcross (fold + 0 (map cog-count (cog-get-atoms 'CrossSection)))
131131 epsilon)
132132)
133133