Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
2.7 KiB

  1. FUNCTION fCompareObjects (Q1, Q2)
  2. cErrors = 0
  3. if Q1.Query <> Q2.Query then
  4. wscript.echo "Error - Query property mismatch"
  5. cErrors = cErrors + 1
  6. end if
  7. if Q1.SortBy <> Q2.SortBy then
  8. wscript.echo "Error - SortBy property mismatch"
  9. cErrors = cErrors + 1
  10. end if
  11. ' if Q1.GroupBy <> Q2.GroupBy then
  12. ' wscript.echo "Error - GroupBy property mismatch"
  13. ' cErrors = cErrors + 1
  14. ' end if
  15. if Q1.Catalog <> Q2.Catalog then
  16. wscript.echo "Error - Catalog property mismatch"
  17. cErrors = cErrors + 1
  18. end if
  19. if Q1.MaxRecords <> Q2.MaxRecords then
  20. wscript.echo "Error - MaxRecords property mismatch"
  21. cErrors = cErrors + 1
  22. end if
  23. if Q1.AllowEnumeration <> Q2.AllowEnumeration then
  24. wscript.echo "Error - AllowEnumeration property mismatch"
  25. cErrors = cErrors + 1
  26. end if
  27. if cErrors <> 0 then
  28. fCompareObjects = 1
  29. else
  30. fCompareObjects = 0
  31. end if
  32. END FUNCTION
  33. wscript.echo "Part 1"
  34. '---- Create a new query object
  35. Set Q1 = CreateObject("ixsso.Query")
  36. Q1.Query = "HTML"
  37. Q1.CiScope = "/"
  38. Q1.CiFlags = "DEEP"
  39. Q1.Columns = "vpath"
  40. Q1.MaxRecords = 150
  41. Q1.SortBy = "vpath[a]"
  42. ' wscript.echo "QueryString is: " & Q1.QueryToURL
  43. '---- Create a second query object and set its state from the first object
  44. Set Q2 = CreateObject("ixsso.Query")
  45. Q2.SetQueryFromURL( Q1.QueryToURL )
  46. cErrors1 = fCompareObjects( Q1, Q2 )
  47. wscript.echo "Part 2"
  48. Q1.Reset
  49. Q2.Reset
  50. Q1.Query = "Full text query & ( c1 q1 ) & ( c2 o2 q2 ) & ( q3b )"
  51. Q2.SetQueryFromURL("qu=Full+text+query&c1=c1&q3=q3a&q1=q1&c2=c2&q2=q2&o2=o2&q3=q3b")
  52. Q1.SortBy = "path,size,rank[d]"
  53. Q2.SetQueryFromURL("so=path&so=size&sd=rank")
  54. Q1.AllowEnumeration=TRUE
  55. Q1.OptimizeFor="performance"
  56. Q2.SetQueryFromURL("ae=1&op=x")
  57. cErrors2 = fCompareObjects( Q1, Q2 )
  58. wscript.echo "Part 3"
  59. Q1.Reset
  60. Q1.SetQueryFromURL( Q2.QueryToURL )
  61. cErrors3 = fCompareObjects( Q1, Q2 )
  62. wscript.echo "Part 4"
  63. Q1.Reset
  64. Q2.Reset
  65. On error resume next
  66. Q1.Codepage = 932
  67. On error goto 0
  68. if 932 = Q1.Codepage then
  69. Q1.SetQueryFromURL("qu=Full text query %8aJ%90%AC")
  70. Q2.SetQueryFromURL("qu=Full+text+query+%u958b%u6210")
  71. Q1.SortBy = "path,size,rank[d]"
  72. Q2.SetQueryFromURL("so=path&so=size&sd=rank")
  73. Q1.AllowEnumeration=TRUE
  74. Q1.OptimizeFor="performance"
  75. Q2.SetQueryFromURL("ae=1&op=x")
  76. else
  77. wscript.echo " Japanese code page not installed."
  78. end if
  79. cErrors4 = fCompareObjects( Q1, Q2 )
  80. ' Q1.Codepage = 1252
  81. ' Response.Write Q1.QueryToURL & "<BR>"
  82. ' Response.Write Q2.QueryToURL & "<BR>"
  83. if 0 = cErrors1+cErrors2+cErrors3+cErrors4 then
  84. wscript.echo("PASS")
  85. else
  86. wscript.echo("FAIL")
  87. end if
  88. set Q1 = nothing
  89. set Q2 = nothing