Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_parse_bye test fails in Linux #50

Closed
ibc opened this issue Jan 12, 2017 · 6 comments
Closed

create_parse_bye test fails in Linux #50

ibc opened this issue Jan 12, 2017 · 6 comments
Assignees
Labels

Comments

@ibc
Copy link
Member

ibc commented Jan 12, 2017

[18:11:21] worker/out/Debug/mediasoup-worker-test
minimum_header .................................................... PASS
buffer_is_too_small ............................................... PASS
version_is_zero ................................................... PASS
length_is_wrong ................................................... PASS
type_is_unknown ................................................... PASS
parse_sdes_chunk .................................................. PASS
create_sdes_chunk ................................................. PASS
parse_sender_report ............................................... PASS
create_sender_report .............................................. PASS
parse_receiver_report ............................................. PASS
create_receiver_report ............................................ PASS
create_parse_bye .................................................. FAIL ***
parse_rtpfb_nack_item ............................................. PASS
create_rtpfb_nack_item ............................................ PASS
parse_rtpfb_tmmb_item ............................................. PASS
parse_rtpfb_tllei_item ............................................ PASS
parse_rtpfb_ecn_item .............................................. PASS
parse_psfb_sli_item ............................................... PASS
parse_psfb_rpsi_item .............................................. PASS
parse_psfb_fir_item ............................................... PASS
parse_psfb_tst_item ............................................... PASS
parse_psfb_vbcm_item .............................................. PASS
parse_psfb_lei_item ............................................... PASS
parse_psfb_afb .................................................... PASS

----------------------------------------------------------------------------

FAILED TESTS


../test/test-rtcp.cpp(339):
    chq_eq_int: 2222 != 2222
../test/test-rtcp.cpp(352):
    chq_eq_int: 2222 != 2222
@ibc ibc added the bug label Jan 12, 2017
@ibc
Copy link
Member Author

ibc commented Jan 12, 2017

Wow, found it! In Linux this does not work as expected:

ByePacket::Iterator it = bye1.Begin();

fct_chk_eq_int(*(it), ssrc1);
fct_chk_eq_int(*(++it), ssrc2);

But this does work:

ByePacket::Iterator it = bye1.Begin();

fct_chk_eq_int(*(it), ssrc1);
it++;
fct_chk_eq_int(*(it), ssrc2);

@ibc ibc closed this as completed in 707a82a Jan 12, 2017
@ibc
Copy link
Member Author

ibc commented Jan 12, 2017

I don't know why this happens. The following C++ foo.cpp code does work as expected in the same Linux server:

#include <iostream>
#include <vector>

int main()
{
  std::vector<int> values;
  
  values.push_back(1111);
  values.push_back(2222);
  
  std::vector<int>::iterator it = values.begin();
  
  std::cout << "first value  : " << *it << std::endl;
  std::cout << "second value : " << *(++it) << std::endl;
}
$ g++ -std=c++11 foo.cpp && ./a.out
first value  : 1111
second value : 2222

So I will reopen the issue.

@ibc ibc reopened this Jan 12, 2017
@jmillan
Copy link
Member

jmillan commented Jan 13, 2017

Weird.., let me check it.

@ibc
Copy link
Member Author

ibc commented Jan 13, 2017

By doing some local testings, I think that parameters given to fct functions must be "static", I mean: those will be evaluated after the full test code ends (not sure how to explain it). So, don't evaluate variables within a fct function.

@jmillan
Copy link
Member

jmillan commented Jan 13, 2017

I guess this issue does not make sense anymore

@jmillan jmillan closed this as completed Jan 13, 2017
@ibc
Copy link
Member Author

ibc commented Jan 13, 2017

Indeed. I've tested the original code with the new test unit framework and it does NOT fail in Linux:

REQUIRE(*(++it) == ssrc2);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants