RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/tests/mongo/ Makefile.am auth.c benchmark.c count_delet...

From: Jeff Johnson <jbj@rpm5.org>
Date: Sat 18 Sep 2010 - 05:25:03 CEST
Message-Id: <20100918032503.E668AC1EFF@rpm5.org>
  RPM Package Manager, CVS Repository
  /cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: rpm                              Date:   18-Sep-2010 05:25:03
  Branch: HEAD                             Handle: 2010091803250300

  Modified files:
    rpm/tests/mongo         Makefile.am auth.c benchmark.c count_delete.c
                            errors.c pair.c simple.c test.h update.c

  Log:
    - mongo: use argv[1] for server's IP address.

  Summary:
    Revision    Changes     Path
    1.2         +3  -3      rpm/tests/mongo/Makefile.am
    1.3         +1  -7      rpm/tests/mongo/auth.c
    1.3         +1  -3      rpm/tests/mongo/benchmark.c
    1.3         +1  -3      rpm/tests/mongo/count_delete.c
    1.3         +1  -7      rpm/tests/mongo/errors.c
    1.3         +1  -7      rpm/tests/mongo/pair.c
    1.3         +1  -7      rpm/tests/mongo/simple.c
    1.2         +1  -9      rpm/tests/mongo/test.h
    1.3         +1  -7      rpm/tests/mongo/update.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/tests/mongo/Makefile.am
  ============================================================================
  $ cvs diff -u -r1.1 -r1.2 Makefile.am
  --- rpm/tests/mongo/Makefile.am	17 Sep 2010 22:49:45 -0000	1.1
  +++ rpm/tests/mongo/Makefile.am	18 Sep 2010 03:25:03 -0000	1.2
  @@ -40,7 +40,7 @@
   #	$(top_builddir)/lib/librpm.la \
   #	$(RPMDB_LDADD)
   
  -mongoserver =		localhost
  +mongoserver =		198.178.231.189		# XXX mongo.rpm5.org
   
   all_types_SOURCES =	all_types.c
   all_types_LDADD =	$(RPMIO_LDADD)
  @@ -84,8 +84,8 @@
   	@-./all_types
   	@echo "--> auth"
   	@-./auth $(mongoserver)
  -	@echo "--> benchmark"
  -	@-./benchmark $(mongoserver)
  +#	@echo "--> benchmark"
  +#	@-./benchmark $(mongoserver)
   	@echo "--> count_delete"
   	@-./count_delete $(mongoserver)
   	@echo "--> endian_swap"
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/tests/mongo/auth.c
  ============================================================================
  $ cvs diff -u -r1.2 -r1.3 auth.c
  --- rpm/tests/mongo/auth.c	17 Sep 2010 22:49:45 -0000	1.2
  +++ rpm/tests/mongo/auth.c	18 Sep 2010 03:25:03 -0000	1.3
  @@ -5,10 +5,6 @@
   
   #include "debug.h"
   
  -#if !defined(TEST_SERVER)
  -#define	TEST_SERVER	"127.0.0.1"
  -#endif
  -
   static mongo_connection conn[1];
   static mongo_connection_options opts;
   static const char* db = "test";
  @@ -16,9 +12,7 @@
   int main(int argc, char *argv[])
   {
   
  -    INIT_SOCKETS_FOR_WINDOWS;
  -
  -    strncpy(opts.host, TEST_SERVER, 255);
  +    strncpy(opts.host, (argc > 1 ? argv[1] : TEST_SERVER), 255);
       opts.host[254] = '\0';
       opts.port = 27017;
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/tests/mongo/benchmark.c
  ============================================================================
  $ cvs diff -u -r1.2 -r1.3 benchmark.c
  --- rpm/tests/mongo/benchmark.c	17 Sep 2010 22:49:45 -0000	1.2
  +++ rpm/tests/mongo/benchmark.c	18 Sep 2010 03:25:03 -0000	1.3
  @@ -363,9 +363,7 @@
   {
       mongo_connection_options opts;
   
  -    INIT_SOCKETS_FOR_WINDOWS;
  -
  -    strncpy(opts.host, TEST_SERVER, 255);
  +    strncpy(opts.host, (argc > 1 ? argv[1] : TEST_SERVER), 255);
       opts.host[254] = '\0';
       opts.port = 27017;
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/tests/mongo/count_delete.c
  ============================================================================
  $ cvs diff -u -r1.2 -r1.3 count_delete.c
  --- rpm/tests/mongo/count_delete.c	17 Sep 2010 22:49:45 -0000	1.2
  +++ rpm/tests/mongo/count_delete.c	18 Sep 2010 03:25:03 -0000	1.3
  @@ -23,9 +23,7 @@
       const char * col = "c.simple";
       const char * ns = "test.c.simple";
   
  -    INIT_SOCKETS_FOR_WINDOWS;
  -    
  -    strncpy(opts.host, TEST_SERVER, 255);
  +    strncpy(opts.host, (argc > 1 ? argv[1] : TEST_SERVER), 255);
       opts.host[254] = '\0';
       opts.port = 27017;
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/tests/mongo/errors.c
  ============================================================================
  $ cvs diff -u -r1.2 -r1.3 errors.c
  --- rpm/tests/mongo/errors.c	17 Sep 2010 22:49:45 -0000	1.2
  +++ rpm/tests/mongo/errors.c	18 Sep 2010 03:25:03 -0000	1.3
  @@ -5,10 +5,6 @@
   
   #include "debug.h"
   
  -#if !defined(TEST_SERVER)
  -#define	TEST_SERVER	"127.0.0.1"
  -#endif
  -
   static mongo_connection conn[1];
   static mongo_connection_options opts;
   static const char* db = "test";
  @@ -18,9 +14,7 @@
   {
       bson obj;
   
  -    INIT_SOCKETS_FOR_WINDOWS;
  -
  -    strncpy(opts.host, TEST_SERVER, 255);
  +    strncpy(opts.host, (argc > 1 ? argv[1] : TEST_SERVER), 255);
       opts.host[254] = '\0';
       opts.port = 27017;
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/tests/mongo/pair.c
  ============================================================================
  $ cvs diff -u -r1.2 -r1.3 pair.c
  --- rpm/tests/mongo/pair.c	17 Sep 2010 22:49:45 -0000	1.2
  +++ rpm/tests/mongo/pair.c	18 Sep 2010 03:25:03 -0000	1.3
  @@ -5,10 +5,6 @@
   
   #include "debug.h"
   
  -#if !defined(TEST_SERVER)
  -#define	TEST_SERVER	"127.0.0.1"
  -#endif
  -
   static mongo_connection conn[1];
   static mongo_connection_options left;
   static mongo_connection_options right;
  @@ -16,9 +12,7 @@
   int main(int argc, char *argv[])
   {
   
  -    INIT_SOCKETS_FOR_WINDOWS;
  -
  -    strncpy(left.host, TEST_SERVER, 255);
  +    strncpy(left.host, (argc > 1 ? argv[1] : TEST_SERVER), 255);
       left.host[254] = '\0';
       left.port = 27017;
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/tests/mongo/simple.c
  ============================================================================
  $ cvs diff -u -r1.2 -r1.3 simple.c
  --- rpm/tests/mongo/simple.c	17 Sep 2010 22:49:45 -0000	1.2
  +++ rpm/tests/mongo/simple.c	18 Sep 2010 03:25:03 -0000	1.3
  @@ -7,10 +7,6 @@
   
   #include "debug.h"
   
  -#if !defined(TEST_SERVER)
  -#define	TEST_SERVER	"127.0.0.1"
  -#endif
  -
   int main(int argc, char *argv[])
   {
       mongo_connection conn[1];
  @@ -24,9 +20,7 @@
       const char * col = "c.simple";
       const char * ns = "test.c.simple";
   
  -    INIT_SOCKETS_FOR_WINDOWS;
  -    
  -    strncpy(opts.host, TEST_SERVER, 255);
  +    strncpy(opts.host, (argc > 1 ? argv[1] : TEST_SERVER), 255);
       opts.host[254] = '\0';
       opts.port = 27017;
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/tests/mongo/test.h
  ============================================================================
  $ cvs diff -u -r1.1 -r1.2 test.h
  --- rpm/tests/mongo/test.h	17 Sep 2010 22:49:45 -0000	1.1
  +++ rpm/tests/mongo/test.h	18 Sep 2010 03:25:03 -0000	1.2
  @@ -6,15 +6,7 @@
           }\
       }while(0)
   
  -#ifdef _WIN32
  -#define INIT_SOCKETS_FOR_WINDOWS \
  -    do{ \
  -        WSADATA out; \
  -        WSAStartup(MAKEWORD(2,2), &out); \
  -    } while(0)
  -#else
  -#define INIT_SOCKETS_FOR_WINDOWS do {} while(0)
  -#endif
  +#define	TEST_SERVER	"127.0.0.1"
   
   #ifdef MONGO_BIG_ENDIAN
   #define bson_little_endian64(out, in) ( bson_swap_endian64(out, in) )
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/tests/mongo/update.c
  ============================================================================
  $ cvs diff -u -r1.2 -r1.3 update.c
  --- rpm/tests/mongo/update.c	17 Sep 2010 22:49:45 -0000	1.2
  +++ rpm/tests/mongo/update.c	18 Sep 2010 03:25:03 -0000	1.3
  @@ -5,10 +5,6 @@
   
   #include "debug.h"
   
  -#if !defined(TEST_SERVER)
  -#define	TEST_SERVER	"127.0.0.1"
  -#endif
  -
   int main(int argc, char *argv[])
   {
       mongo_connection conn[1];
  @@ -21,9 +17,7 @@
       const char* col = "c.update_test";
       const char* ns = "test.c.update_test";
   
  -    INIT_SOCKETS_FOR_WINDOWS;
  -
  -    strncpy(opts.host, TEST_SERVER, 255);
  +    strncpy(opts.host, (argc > 1 ? argv[1] : TEST_SERVER), 255);
       opts.host[254] = '\0';
       opts.port = 27017;
   
  @@ .
Received on Sat Sep 18 05:25:04 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.