Merge lp://staging/~manishsinha/zeitgeist-sharp/testsuite into lp://staging/~zeitgeist-sharp/zeitgeist-sharp/trunk

Status: Rejected
Rejected by: Manish Sinha (मनीष सिन्हा)
Proposed branch: lp://staging/~manishsinha/zeitgeist-sharp/testsuite
Merge into: lp://staging/~zeitgeist-sharp/zeitgeist-sharp/trunk
Diff against target: 1632 lines (+1078/-75)
19 files modified
Zeitgeist.Testsuite/Datamodel/TestInterpretation.cs (+449/-0)
Zeitgeist.Testsuite/Datamodel/TestManifestation.cs (+156/-0)
Zeitgeist.Testsuite/Log/TestDeleteEvents.cs (+50/-0)
Zeitgeist.Testsuite/Log/TestFindEventIds.cs (+36/-0)
Zeitgeist.Testsuite/Log/TestFindEvents.cs (+43/-0)
Zeitgeist.Testsuite/Log/TestGetEvents.cs (+54/-0)
Zeitgeist.Testsuite/Log/TestInsertEvents.cs (+38/-0)
Zeitgeist.Testsuite/Zeitgeist.Testsuite.csproj (+67/-0)
Zeitgeist.sln (+6/-0)
Zeitgeist/Client/ILog.cs (+6/-6)
Zeitgeist/Datamodel/Event.cs (+16/-11)
Zeitgeist/Datamodel/Interpretation.cs (+46/-30)
Zeitgeist/Datamodel/Manifestation.cs (+7/-7)
Zeitgeist/Datamodel/NameUri.cs (+2/-0)
Zeitgeist/Datamodel/Subject.cs (+12/-1)
Zeitgeist/Datamodel/TimeRange.cs (+50/-11)
Zeitgeist/LogClient.cs (+29/-6)
Zeitgeist/Zeitgeist.csproj (+0/-1)
Zeitgeist/ZsUtils.cs (+11/-2)
To merge this branch: bzr merge lp://staging/~manishsinha/zeitgeist-sharp/testsuite
Reviewer Review Type Date Requested Status
Manish Sinha (मनीष सिन्हा) Disapprove
Mirco Bauer source Needs Fixing
Seif Lotfy Pending
Review via email: mp+37400@code.staging.launchpad.net

Commit message

Added lots of Unit Tests

Description of the change

Added lots of Unit Tests

To post a comment you must log in.
Revision history for this message
Mirco Bauer (meebey) wrote :

Cosmetic issues:
Empty Test.cs file

Serious issues:
in Zeitgeist/Datamodel/Event.cs
1057 - private string[] _metadata;
1058 - private string[][] _subjects;
1059 - private byte[] _payload;
1060 + public string[] _metadata;
1061 + public string[][] _subjects;
1062 + public byte[] _payload;
Those fields would not be exposed in this way! Re-check if you need to expose those fields, if so add properties for them. Are they only needed for test-cases? That needs special handling then (internal accessor).

in Zeitgeist/Datamodel/TimeRange.cs
1492 + public Int64 _begin;
1493 +
1494 + public Int64 _end;
Fields should never be public, as there are public properties I guess this is a typo.

Unsure:
in Zeitgeist/Datamodel/Subject.cs:
1385 + public Subject()
1386 + {
1387 + Uri = string.Empty;
1388 + Origin = string.Empty;
1389 + MimeType = string.Empty;
1390 + Text = string.Empty;
1391 + Storage = string.Empty;
1392 + Interpretation = new NameUri();
1393 + Manifestation = new NameUri();
1394 + }
Is the D-Bus API / Zeitgeist expecting empty strings in the case of "unset" / unspecified values? Because this is bad coding style to simply pre-init all fields for no good reason.

review: Needs Fixing (source)
Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote :

Cosmetic Issues:
Empty.cs file can be removed. Not a big deal

Serious Issues:
Well those fields have been made public since NDesk.DBus was throwing exceptions which sounded like "Backing field not found/accessible". I don't understand what the problem is. If this problem happens in one place, then it's fine, but it's happening with all the types which are being sent over DBus. i.e. RawEvent and TimeRange
Since the problem is occurring all over, then is it due to NDesk.DBus being at fault or some programming mistake.
If it is a progg mistake, then it is really tough to find since NDesk.DBus docs are nearly non-existant. Otherwise the way I was keeping it(private fields) are exactly how classes should be written.

If you can find out how it is to be done, can you please explain otherwise it is seriously a big headache. It doesnt work when fields are private

UnSure:
DBus doesnt support null. There is no datatype such as null over DBus. So every nullablle type can be to initialized before passing it over DBus. In this case strings are set to string.Empty
I know it is bad coding style, but possible to fix only if DBus starts taking null as a value.

41. By Manish Sinha (मनीष सिन्हा)

Merge with fixed build system and also changed the type from struct to class

Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote :

I merged the trunk with this branch and resolved all the merge conflicts. This branch should merge with trunk without any conflicts.

I still want people to try out this branch with their zeitgeist-daemon running as 5 UnitTests are still failing on my laptop whereas all pass on my desktop. On my desktop I have two installations - 10.04 and 10.10RC with MonoDevelop 2.4 and Mono 2.6.7 (from badgerports) and on both installs they work well

On laptop I have 10.04 with same MD 2.4 and Mono 2.6.7(badgerports) and 5 unit tests fail.

If unit tests failing can be fixed, there is nothing preventing this from getting merged.

I have discussed with meebey and it looks public fields cannot be avoided. Probably some problems with ndesk-dbus. When zg-sharp is migrated to dbus-sharp, then we can fix this public field issue (Provided dbus-sharp doesnt have the same issue)

42. By Manish Sinha (मनीष सिन्हा)

Fixed Interpretation and Manifestation to deal with unknown Uris and Fixed all the test cases. Removed Test.cs file
Added a method in ZsUtils.cs which helps in creating a human readable variant of Manifestation and Interpretation Uri

Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote :

Chuck the previous message. I was running a very old version of Zeitgeist (some 0.3.x), removed it and installed from the trunk.

Now it works

Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote :

I tried running all unit tests and it works. Plus, I removed the Test.cs file.

Don't find any show-stoppers here.

review: Approve (code unit test naming)
Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote :

I rejected this merge since there is a superseded version of this which is in a different branch. Here is the merge request
https://code.launchpad.net/~manishsinha/zeitgeist-sharp/fixed-monitor/+merge/38948

review: Disapprove

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches