Skip to content
This repository has been archived by the owner on Apr 6, 2019. It is now read-only.

Issue #37 #42

Merged
merged 5 commits into from
Feb 5, 2017
Merged

Issue #37 #42

merged 5 commits into from
Feb 5, 2017

Conversation

navossoc
Copy link
Contributor

@navossoc navossoc commented Feb 4, 2017

@Cylix and @simpuc please take a look about what was being discussed on issue #37.

I just made a little change on the constructor (explict keyword) and included another constructor.

All tests seems to pass...

PS: To this fix works properly tacopie also needs some fix for the std::atomic issues. Should I do a pull request there too?

[----------] Global test environment set-up.
[----------] 25 tests from RedisClient
[ RUN      ] RedisClient.ValidConnectionDefaultParams
[       OK ] RedisClient.ValidConnectionDefaultParams (35 ms)
[ RUN      ] RedisClient.ValidConnectionDefinedHost
[       OK ] RedisClient.ValidConnectionDefinedHost (1 ms)
[ RUN      ] RedisClient.InvalidConnection
[       OK ] RedisClient.InvalidConnection (12 ms)
[ RUN      ] RedisClient.AlreadyConnected
[       OK ] RedisClient.AlreadyConnected (1 ms)
[ RUN      ] RedisClient.Disconnection
[       OK ] RedisClient.Disconnection (1 ms)
[ RUN      ] RedisClient.DisconnectionNotConnected
[       OK ] RedisClient.DisconnectionNotConnected (0 ms)
[ RUN      ] RedisClient.CommitConnected
[       OK ] RedisClient.CommitConnected (1 ms)
[ RUN      ] RedisClient.CommitNotConnected
[       OK ] RedisClient.CommitNotConnected (1 ms)
[ RUN      ] RedisClient.SyncCommitConnected
[       OK ] RedisClient.SyncCommitConnected (1 ms)
[ RUN      ] RedisClient.SyncCommitNotConnected
[       OK ] RedisClient.SyncCommitNotConnected (1 ms)
[ RUN      ] RedisClient.SyncCommitTimeoutConnected
[       OK ] RedisClient.SyncCommitTimeoutConnected (1 ms)
[ RUN      ] RedisClient.SyncCommitTimeoutNotConnected
[       OK ] RedisClient.SyncCommitTimeoutNotConnected (1 ms)
[ RUN      ] RedisClient.SyncCommitTimeout
[       OK ] RedisClient.SyncCommitTimeout (1001 ms)
[ RUN      ] RedisClient.SyncCommitNoTimeout
[       OK ] RedisClient.SyncCommitNoTimeout (1004 ms)
[ RUN      ] RedisClient.SendConnected
[       OK ] RedisClient.SendConnected (0 ms)
[ RUN      ] RedisClient.SendNotConnected
[       OK ] RedisClient.SendNotConnected (0 ms)
[ RUN      ] RedisClient.SendConnectedSyncCommitConnected
[       OK ] RedisClient.SendConnectedSyncCommitConnected (1 ms)
[ RUN      ] RedisClient.SendNotConnectedSyncCommitConnected
[       OK ] RedisClient.SendNotConnectedSyncCommitConnected (1 ms)
[ RUN      ] RedisClient.SendNotConnectedSyncCommitNotConnectedSyncCommitConnected
[       OK ] RedisClient.SendNotConnectedSyncCommitNotConnectedSyncCommitConnected (1 ms)
[ RUN      ] RedisClient.Send
[       OK ] RedisClient.Send (1 ms)
[ RUN      ] RedisClient.MultipleSend
[       OK ] RedisClient.MultipleSend (1 ms)
[ RUN      ] RedisClient.MultipleSendPipeline
[       OK ] RedisClient.MultipleSendPipeline (1 ms)
[ RUN      ] RedisClient.DisconnectionHandlerWithQuit
[       OK ] RedisClient.DisconnectionHandlerWithQuit (101 ms)
[ RUN      ] RedisClient.DisconnectionHandlerWithoutQuit
[       OK ] RedisClient.DisconnectionHandlerWithoutQuit (2012 ms)
[ RUN      ] RedisClient.ClearBufferOnError
[       OK ] RedisClient.ClearBufferOnError (3 ms)
[----------] 25 tests from RedisClient (4206 ms total)

[----------] 29 tests from RedisSubscriber
[ RUN      ] RedisSubscriber.ValidConnectionDefaultParams
[       OK ] RedisSubscriber.ValidConnectionDefaultParams (1 ms)
[ RUN      ] RedisSubscriber.ValidConnectionDefinedHost
[       OK ] RedisSubscriber.ValidConnectionDefinedHost (1 ms)
[ RUN      ] RedisSubscriber.InvalidConnection
[       OK ] RedisSubscriber.InvalidConnection (1 ms)
[ RUN      ] RedisSubscriber.AlreadyConnected
[       OK ] RedisSubscriber.AlreadyConnected (1 ms)
[ RUN      ] RedisSubscriber.Disconnection
[       OK ] RedisSubscriber.Disconnection (0 ms)
[ RUN      ] RedisSubscriber.DisconnectionNotConnected
[       OK ] RedisSubscriber.DisconnectionNotConnected (0 ms)
[ RUN      ] RedisSubscriber.CommitConnected
[       OK ] RedisSubscriber.CommitConnected (0 ms)
[ RUN      ] RedisSubscriber.CommitNotConnected
[       OK ] RedisSubscriber.CommitNotConnected (1 ms)
[ RUN      ] RedisSubscriber.SubscribeConnected
[       OK ] RedisSubscriber.SubscribeConnected (1 ms)
[ RUN      ] RedisSubscriber.PSubscribeConnected
[       OK ] RedisSubscriber.PSubscribeConnected (1 ms)
[ RUN      ] RedisSubscriber.UnsubscribeConnected
[       OK ] RedisSubscriber.UnsubscribeConnected (1 ms)
[ RUN      ] RedisSubscriber.PUnsubscribeConnected
[       OK ] RedisSubscriber.PUnsubscribeConnected (0 ms)
[ RUN      ] RedisSubscriber.SubscribeNotConnected
[       OK ] RedisSubscriber.SubscribeNotConnected (0 ms)
[ RUN      ] RedisSubscriber.PSubscribeNotConnected
[       OK ] RedisSubscriber.PSubscribeNotConnected (0 ms)
[ RUN      ] RedisSubscriber.UnsubscribeNotConnected
[       OK ] RedisSubscriber.UnsubscribeNotConnected (0 ms)
[ RUN      ] RedisSubscriber.PUnsubscribeNotConnected
[       OK ] RedisSubscriber.PUnsubscribeNotConnected (0 ms)
[ RUN      ] RedisSubscriber.SubConnectedCommitConnected
[       OK ] RedisSubscriber.SubConnectedCommitConnected (3 ms)
[ RUN      ] RedisSubscriber.SubNotConnectedCommitConnected
[       OK ] RedisSubscriber.SubNotConnectedCommitConnected (2 ms)
[ RUN      ] RedisSubscriber.SubNotConnectedCommitNotConnectedCommitConnected
[       OK ] RedisSubscriber.SubNotConnectedCommitNotConnectedCommitConnected (2003 ms)
[ RUN      ] RedisSubscriber.SubscribeSomethingPublished
[       OK ] RedisSubscriber.SubscribeSomethingPublished (2 ms)
[ RUN      ] RedisSubscriber.SubscribeMultiplePublished
[       OK ] RedisSubscriber.SubscribeMultiplePublished (2 ms)
[ RUN      ] RedisSubscriber.SubscribeNothingPublished
[       OK ] RedisSubscriber.SubscribeNothingPublished (2001 ms)
[ RUN      ] RedisSubscriber.MultipleSubscribeSomethingPublished
[       OK ] RedisSubscriber.MultipleSubscribeSomethingPublished (3 ms)
[ RUN      ] RedisSubscriber.PSubscribeSomethingPublished
[       OK ] RedisSubscriber.PSubscribeSomethingPublished (2 ms)
[ RUN      ] RedisSubscriber.PSubscribeMultiplePublished
[       OK ] RedisSubscriber.PSubscribeMultiplePublished (3 ms)
[ RUN      ] RedisSubscriber.PSubscribeNothingPublished
[       OK ] RedisSubscriber.PSubscribeNothingPublished (2002 ms)
[ RUN      ] RedisSubscriber.MultiplePSubscribeSomethingPublished
[       OK ] RedisSubscriber.MultiplePSubscribeSomethingPublished (3 ms)
[ RUN      ] RedisSubscriber.Unsubscribe
[       OK ] RedisSubscriber.Unsubscribe (3 ms)
[ RUN      ] RedisSubscriber.PUnsubscribe
[       OK ] RedisSubscriber.PUnsubscribe (2 ms)
[----------] 29 tests from RedisSubscriber (6076 ms total)

[----------] 6 tests from Reply
[ RUN      ] Reply.NullReply
[       OK ] Reply.NullReply (1 ms)
[ RUN      ] Reply.Error
[       OK ] Reply.Error (0 ms)
[ RUN      ] Reply.BulkString
[       OK ] Reply.BulkString (0 ms)
[ RUN      ] Reply.SimpleString
[       OK ] Reply.SimpleString (1 ms)
[ RUN      ] Reply.Integer
[       OK ] Reply.Integer (2 ms)
[ RUN      ] Reply.Array
[       OK ] Reply.Array (1 ms)
[----------] 6 tests from Reply (10 ms total)

[----------] 7 tests from ArrayBuilder
[ RUN      ] ArrayBuilder.WithNoData
[       OK ] ArrayBuilder.WithNoData (0 ms)
[ RUN      ] ArrayBuilder.WithNotEnoughData
[       OK ] ArrayBuilder.WithNotEnoughData (0 ms)
[ RUN      ] ArrayBuilder.WithPartOfEndSequence
[       OK ] ArrayBuilder.WithPartOfEndSequence (0 ms)
[ RUN      ] ArrayBuilder.WithAllInOneTime
[       OK ] ArrayBuilder.WithAllInOneTime (0 ms)
[ RUN      ] ArrayBuilder.WithAllInMultipleTimes
[       OK ] ArrayBuilder.WithAllInMultipleTimes (0 ms)
[ RUN      ] ArrayBuilder.EmptyArray
[       OK ] ArrayBuilder.EmptyArray (0 ms)
[ RUN      ] ArrayBuilder.InvalidSize
[       OK ] ArrayBuilder.InvalidSize (0 ms)
[----------] 7 tests from ArrayBuilder (7 ms total)

[----------] 6 tests from BuildersFactory
[ RUN      ] BuildersFactory.Array
[       OK ] BuildersFactory.Array (0 ms)
[ RUN      ] BuildersFactory.BulkString
[       OK ] BuildersFactory.BulkString (0 ms)
[ RUN      ] BuildersFactory.Error
[       OK ] BuildersFactory.Error (0 ms)
[ RUN      ] BuildersFactory.Integer
[       OK ] BuildersFactory.Integer (0 ms)
[ RUN      ] BuildersFactory.SimpleString
[       OK ] BuildersFactory.SimpleString (0 ms)
[ RUN      ] BuildersFactory.Unknown
[       OK ] BuildersFactory.Unknown (0 ms)
[----------] 6 tests from BuildersFactory (8 ms total)

[----------] 9 tests from BulkStringBuilder
[ RUN      ] BulkStringBuilder.WithNoData
[       OK ] BulkStringBuilder.WithNoData (0 ms)
[ RUN      ] BulkStringBuilder.WithNotEnoughData
[       OK ] BulkStringBuilder.WithNotEnoughData (0 ms)
[ RUN      ] BulkStringBuilder.WithPartOfEndSequence
[       OK ] BulkStringBuilder.WithPartOfEndSequence (0 ms)
[ RUN      ] BulkStringBuilder.Null
[       OK ] BulkStringBuilder.Null (0 ms)
[ RUN      ] BulkStringBuilder.WithAllInOneTime
[       OK ] BulkStringBuilder.WithAllInOneTime (0 ms)
[ RUN      ] BulkStringBuilder.WithAllInMultipleTimes
[       OK ] BulkStringBuilder.WithAllInMultipleTimes (0 ms)
[ RUN      ] BulkStringBuilder.WithAllInMultipleTimes2
[       OK ] BulkStringBuilder.WithAllInMultipleTimes2 (0 ms)
[ RUN      ] BulkStringBuilder.WithAllInMultipleTimes3
[       OK ] BulkStringBuilder.WithAllInMultipleTimes3 (0 ms)
[ RUN      ] BulkStringBuilder.InvalidEndSequence
[       OK ] BulkStringBuilder.InvalidEndSequence (0 ms)
[----------] 9 tests from BulkStringBuilder (8 ms total)

[----------] 7 tests from ErrorBuilder
[ RUN      ] ErrorBuilder.WithNoData
[       OK ] ErrorBuilder.WithNoData (0 ms)
[ RUN      ] ErrorBuilder.WithNotEnoughData
[       OK ] ErrorBuilder.WithNotEnoughData (0 ms)
[ RUN      ] ErrorBuilder.WithPartOfEndSequence
[       OK ] ErrorBuilder.WithPartOfEndSequence (0 ms)
[ RUN      ] ErrorBuilder.WithAllInOneTime
[       OK ] ErrorBuilder.WithAllInOneTime (0 ms)
[ RUN      ] ErrorBuilder.WithAllInMultipleTimes
[       OK ] ErrorBuilder.WithAllInMultipleTimes (0 ms)
[ RUN      ] ErrorBuilder.WithAllInMultipleTimes2
[       OK ] ErrorBuilder.WithAllInMultipleTimes2 (0 ms)
[ RUN      ] ErrorBuilder.WithAllInMultipleTimes3
[       OK ] ErrorBuilder.WithAllInMultipleTimes3 (0 ms)
[----------] 7 tests from ErrorBuilder (8 ms total)

[----------] 10 tests from IntegerBuilder
[ RUN      ] IntegerBuilder.WithNoData
[       OK ] IntegerBuilder.WithNoData (0 ms)
[ RUN      ] IntegerBuilder.WithNotEnoughData
[       OK ] IntegerBuilder.WithNotEnoughData (0 ms)
[ RUN      ] IntegerBuilder.WithPartOfEndSequence
[       OK ] IntegerBuilder.WithPartOfEndSequence (0 ms)
[ RUN      ] IntegerBuilder.WithAllInOneTime
[       OK ] IntegerBuilder.WithAllInOneTime (0 ms)
[ RUN      ] IntegerBuilder.With64BitInteger
[       OK ] IntegerBuilder.With64BitInteger (0 ms)
[ RUN      ] IntegerBuilder.NegativeNumber
[       OK ] IntegerBuilder.NegativeNumber (0 ms)
[ RUN      ] IntegerBuilder.WithAllInMultipleTimes
[       OK ] IntegerBuilder.WithAllInMultipleTimes (0 ms)
[ RUN      ] IntegerBuilder.WithAllInMultipleTimes2
[       OK ] IntegerBuilder.WithAllInMultipleTimes2 (0 ms)
[ RUN      ] IntegerBuilder.WithAllInMultipleTimes3
[       OK ] IntegerBuilder.WithAllInMultipleTimes3 (0 ms)
[ RUN      ] IntegerBuilder.WrongChar
[       OK ] IntegerBuilder.WrongChar (0 ms)
[----------] 10 tests from IntegerBuilder (13 ms total)

[----------] 5 tests from ReplyBuilder
[ RUN      ] ReplyBuilder.WithNoData
[       OK ] ReplyBuilder.WithNoData (0 ms)
[ RUN      ] ReplyBuilder.WithNotEnoughData
[       OK ] ReplyBuilder.WithNotEnoughData (0 ms)
[ RUN      ] ReplyBuilder.WithPartOfEndSequence
[       OK ] ReplyBuilder.WithPartOfEndSequence (0 ms)
[ RUN      ] ReplyBuilder.WithAllInOneTime
[       OK ] ReplyBuilder.WithAllInOneTime (0 ms)
[ RUN      ] ReplyBuilder.WithAllInMultipleTimes
[       OK ] ReplyBuilder.WithAllInMultipleTimes (0 ms)
[----------] 5 tests from ReplyBuilder (4 ms total)

[----------] 7 tests from SimpleStringBuilder
[ RUN      ] SimpleStringBuilder.WithNoData
[       OK ] SimpleStringBuilder.WithNoData (0 ms)
[ RUN      ] SimpleStringBuilder.WithNotEnoughData
[       OK ] SimpleStringBuilder.WithNotEnoughData (0 ms)
[ RUN      ] SimpleStringBuilder.WithPartOfEndSequence
[       OK ] SimpleStringBuilder.WithPartOfEndSequence (0 ms)
[ RUN      ] SimpleStringBuilder.WithAllInOneTime
[       OK ] SimpleStringBuilder.WithAllInOneTime (0 ms)
[ RUN      ] SimpleStringBuilder.WithAllInMultipleTimes
[       OK ] SimpleStringBuilder.WithAllInMultipleTimes (0 ms)
[ RUN      ] SimpleStringBuilder.WithAllInMultipleTimes2
[       OK ] SimpleStringBuilder.WithAllInMultipleTimes2 (1 ms)
[ RUN      ] SimpleStringBuilder.WithAllInMultipleTimes3
[       OK ] SimpleStringBuilder.WithAllInMultipleTimes3 (1 ms)
[----------] 7 tests from SimpleStringBuilder (8 ms total)

[----------] Global test environment tear-down
[==========] 111 tests from 10 test cases ran. (10362 ms total)
[  PASSED  ] 111 tests.

@Cylix
Copy link
Owner

Cylix commented Feb 4, 2017

Hi,

Thanks a lot for the PR, saves me some time and I appreciate a lot :)

There is apparently an issue with the build on Mac+clang. I checked on my phone and I think it might be because is not included in redis_error.hpp. I can't check for now, but will try to fix that tonight if you can't do it in the meantime.

As for tacopie, you can do a PR too (I'm the owner of the library), that would be awesome!

Thanks again :)

@navossoc
Copy link
Contributor Author

navossoc commented Feb 4, 2017

I did a PR on tacopie also, everything looks good.
If you accept the PR on tacopie first, I think we can build here again without any errors.

For me, seems this error is coming from tacopie (because it's not fixed yet).

I'm not sure how you will manage this dependency issue.

Not exactly related, but tacopie is a dependency since 3.0.0, right?

cpp_redis has no dependency. Its only requirement is C++11.

Maybe you should update your README.md.

@Cylix
Copy link
Owner

Cylix commented Feb 5, 2017

Ok, I did have a look.

The compilation error on mac+clang was fixed by adding the #include <string> in the redis_error.hpp file.

Moreover, I also got some warnings on mac+clang concerning the usage of ATOMIC_VAR_INIT: braces around scalar initializer [-Wbraced-scalar-init].

AFter some searches, did find a relevant post about it: https://llvm.org/bugs/show_bug.cgi?id=23899.

So I updated the PR to use the right syntax (aka atomic_bool var = ATOMIC_VAR_INIT(val) instead of var(ATOMIC_VAR_INIT(val)).

Travis looks fine with the changes, so I merge: do not hesitate to come back to me if there is still any issue.

I also merged PR on tacopie, making the same changes concerning ATOMIC_VAR_INIT.

Thanks again a loooot for this, that's really cool!

Have a nice one :)

@Cylix Cylix merged commit c441de0 into Cylix:master Feb 5, 2017
@navossoc
Copy link
Contributor Author

navossoc commented Feb 5, 2017

Hello @Cylix, thanks for your time and the library, but seems we have a problem 😕
On the attempt to fix the warnings on mac+clang, msvc 2013 builds got broken again (cpp_redis and tacopie).

I'm doing some tests here now and I'll let you know.

If I get to some workaround, I'll do another PR, ok?

--- EDIT ---

I have submitted another PR for tacopie and cpp_redis.

[]'s

@navossoc navossoc deleted the issue37 branch February 5, 2017 06:16
@Cylix
Copy link
Owner

Cylix commented Feb 5, 2017

Thanks for your time too, I really appreciate :)
Waiting for the travis result and I merge that!
I hope you'll be satisfy with cpp_redis.

@simpuc
Copy link

simpuc commented Feb 6, 2017

I confirm the resolution
Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants