[haiku-commits] Re: haiku: hrev43697 - in src: servers/media_addon servers/media kits/media

  • From: Siarzhuk Zharski <zharik@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 29 Jan 2012 00:51:25 +0100

Hi Fredrik,

Am 29.01.2012 00:09, schrieb fredrik@xxxxxxxxx:
diff --git a/src/kits/media/MediaRoster.cpp b/src/kits/media/MediaRoster.cpp
index 82c69c7..c857652 100644
--- a/src/kits/media/MediaRoster.cpp
+++ b/src/kits/media/MediaRoster.cpp
@@ -1921,7 +1921,7 @@ BMediaRosterEx::RegisterNode(BMediaNode* node, 
media_addon_id addOnID,
                BMediaAddOn* addon = node->AddOn(&testFlavorID);

                ASSERT(addOnID == (addon != NULL ? addon->AddonID() : -1));
-               ASSERT(flavorID == testFlavorID);
+//             ASSERT(flavorID == testFlavorID);

Assertion is a widely used programming technique - just google for the term to get some info about it. ;-)

ASSERT was set here to check the case of equality of parameters that must be true in normal case. It was intentionally set by original developer in hope to catch fail cases during future development. If you run into it that means that something _already_ goes bad in your program. You have to clear why the comparison is wrong here instead of just disabling the assertion. Of course this check can be obsoleted nowadays but I suspect that is not the case. ;-)

Kind Regards,

Other related posts: