[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-lib/master] eventdns lines have 1 and 0 for true and false.



commit e8ed8fb812f7aa101a1492c456544fdb0660372b
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Fri Feb 17 09:02:56 2012 +0100

    eventdns lines have 1 and 0 for true and false.
---
 .../descriptor/impl/ServerDescriptorImpl.java      |    4 ++--
 .../descriptor/impl/ServerDescriptorImplTest.java  |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/org/torproject/descriptor/impl/ServerDescriptorImpl.java b/src/org/torproject/descriptor/impl/ServerDescriptorImpl.java
index 76873dc..67b4d09 100644
--- a/src/org/torproject/descriptor/impl/ServerDescriptorImpl.java
+++ b/src/org/torproject/descriptor/impl/ServerDescriptorImpl.java
@@ -340,9 +340,9 @@ public class ServerDescriptorImpl extends DescriptorImpl
     if (partsNoOpt.length != 2) {
       throw new DescriptorParseException("Illegal line '" + line + "'.");
     }
-    if (partsNoOpt[1].equals("true")) {
+    if (partsNoOpt[1].equals("1")) {
       this.usesEnhancedDnsLogic = true;
-    } else if (partsNoOpt[1].equals("false")) {
+    } else if (partsNoOpt[1].equals("0")) {
       this.usesEnhancedDnsLogic = false;
     } else {
       throw new DescriptorParseException("Illegal line '" + line + "'.");
diff --git a/test/org/torproject/descriptor/impl/ServerDescriptorImplTest.java b/test/org/torproject/descriptor/impl/ServerDescriptorImplTest.java
index 889fce4..85db9df 100644
--- a/test/org/torproject/descriptor/impl/ServerDescriptorImplTest.java
+++ b/test/org/torproject/descriptor/impl/ServerDescriptorImplTest.java
@@ -1021,27 +1021,27 @@ public class ServerDescriptorImplTest {
   @Test()
   public void testEventdnsOpt() throws DescriptorParseException {
     ServerDescriptor descriptor = DescriptorBuilder.
-        createWithEventdnsLine("opt eventdns true");
+        createWithEventdnsLine("opt eventdns 1");
     assertTrue(descriptor.getUsesEnhancedDnsLogic());
   }
 
   @Test()
   public void testEventdnsTrue() throws DescriptorParseException {
     ServerDescriptor descriptor = DescriptorBuilder.
-        createWithEventdnsLine("eventdns true");
+        createWithEventdnsLine("eventdns 1");
     assertTrue(descriptor.getUsesEnhancedDnsLogic());
   }
 
   @Test()
   public void testEventdnsFalse() throws DescriptorParseException {
     ServerDescriptor descriptor = DescriptorBuilder.
-        createWithEventdnsLine("eventdns false");
+        createWithEventdnsLine("eventdns 0");
     assertFalse(descriptor.getUsesEnhancedDnsLogic());
   }
 
   @Test(expected = DescriptorParseException.class)
   public void testEventdns1() throws DescriptorParseException {
-    DescriptorBuilder.createWithEventdnsLine("eventdns 1");
+    DescriptorBuilder.createWithEventdnsLine("eventdns true");
   }
 
   @Test(expected = DescriptorParseException.class)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits