HGStXTests: added tests for ProjectDefinition>>fileRevisionNr/fileRevisionNr.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 23 Nov 2012 11:25:28 +0000
changeset 98 8982e002d0ab
parent 97 473dfe20dfea
child 99 a880b85982fb
HGStXTests: added tests for ProjectDefinition>>fileRevisionNr/fileRevisionNr. Original implementation was too CVS specific. If it is not fixed, generated package.rc file is invalid and thus package fails to compile on Windows. These tests checks for that.
mercurial/HGStXTests.st
mercurial/mercurial.rc
--- a/mercurial/HGStXTests.st	Fri Nov 23 10:21:39 2012 +0000
+++ b/mercurial/HGStXTests.st	Fri Nov 23 11:25:28 2012 +0000
@@ -366,6 +366,50 @@
     "Modified: / 22-11-2012 / 11:43:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!HGStXTests methodsFor:'tests - misc'!
+
+test_misc_fileReleaseAndRevisionNr
+    "
+    ProjectDefinition>>fileReleaseNr and ProjectDefinition>>fileRevisionNr
+    are used to generate package.rc used on Windows.
+
+    String returned must be an integer and must be a valid short value 
+    - otherwise, BCC won't compile/link the library.
+
+    If this test fail it means that implementation fileReleaseNr/fileRevisionNr
+    is rubbish. As of 2012-11-23, it uses 'self revision' and expects
+    (but does not check!!) the resulting string is in X.Y form. In mercurial,
+    #revision returns node id (SHA1 hash string).
+
+    It has to be fixed there!!
+    "
+
+    | repo |
+
+    repo := self repositoryNamed: 'mocks/hg/p1'.
+    Smalltalk loadPackage:'mocks:hg/p1'.
+
+    self assert: (mocks_hg_p1 fileReleaseNr allSatisfy:[:c|c isDigit]).
+    self assert: (mocks_hg_p1 fileReleaseNr asInteger < 16r7FFF).
+
+    self assert: (mocks_hg_p1 fileRevisionNr allSatisfy:[:c|c isDigit]).
+    self assert: (mocks_hg_p1 fileRevisionNr asInteger < 16r7FFF).
+
+    "Created: / 23-11-2012 / 11:02:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_misc_hgRevision_01
+    | repo |
+
+    repo := self repositoryNamed: 'mocks/hg/p1'.
+    Smalltalk loadPackage:'mocks:hg/p1'.
+    self dumpRepositoryLog: repo. 
+
+    self assert: mocks_hg_p1 hgLogicalRevision asString = '1:e0bec585af86b3ee98047baa69530b2b2484c9c0'.
+
+    "Created: / 23-11-2012 / 11:00:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !HGStXTests methodsFor:'utilities'!
 
 cleanup
--- a/mercurial/mercurial.rc	Fri Nov 23 10:21:39 2012 +0000
+++ b/mercurial/mercurial.rc	Fri Nov 23 11:25:28 2012 +0000
@@ -3,7 +3,7 @@
 // automagically generated from the projectDefinition: stx_libscm_mercurial.
 //
 VS_VERSION_INFO VERSIONINFO
-  FILEVERSION     6,2,8741,8741
+  FILEVERSION     6,2,32767,32767
   PRODUCTVERSION  6,2,3,1
 #if (__BORLANDC__)
   FILEFLAGSMASK   VS_FF_DEBUG | VS_FF_PRERELEASE
@@ -20,12 +20,12 @@
     BEGIN
       VALUE "CompanyName", "eXept Software AG\0"
       VALUE "FileDescription", "Smalltalk/X Class library (LIB)\0"
-      VALUE "FileVersion", "6.2.874180757753826348882.874180757753826348882\0"
+      VALUE "FileVersion", "6.2.32767.32767\0"
       VALUE "InternalName", "stx:libscm/mercurial\0"
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2012\nCopyright eXept Software AG 1998-2012\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.3.1\0"
-      VALUE "ProductDate", "Thu, 22 Nov 2012 23:58:02 GMT\0"
+      VALUE "ProductDate", "Fri, 23 Nov 2012 11:24:45 GMT\0"
     END
 
   END